Database Join Concat Label renders properly in form view, not in list view

flodg3

New Member
I am hoping that this is either a straight forward fix or a simple 'sorry'.

I have a database join element which works fine. It has a simple concat label which works fine in forms. It loads correctly in new forms and while re-editing saved forms. However the concat label does not render on list view, instead the join table id is displayed. I can't find any reason that it wouldn't also display the concat label.

I have looked through the forums and also on the Wiki. I started my morning by updating from the GitHub in order to clear a previously posted about warning message (thank you again for your help there). I can post images and give examples but I'm hoping this explanation will be enough to get at least an initial response.

For what it's worth, I tried additionally selecting a label to display (yes, in addition to having concat label). Magically, this label loads fine in the list view and the concat label still loads fine in the form view. I'm scratching my head over what might be preventing the concat label from loading in the list view.

Thank you for any help.
 
Can you paste your exact concat expression here?

Basically I want to see if you are using the {thistable} placeholder. For instance ...

{thistable}.last_name, ', ', {thistable}.first_name

... or whether you are using the literal table name ...

yourtable.last_name, ', ', yourtable.first_name

... or no table name at all ...

last_name, ', ', first_name

The format you should be using is the {thistable} one.

-- hugh
 
So the database join element is called "home_lodge" and it is in a table called Brothers. It is trying to display rows from another table called Lodges, which holds the name and number of the Lodges.

Originally I had the code as the following because, as I was constructed the form, it was what worked. Here name and number are columns in the Lodges table.
name," No. ",number

When I try the following, I get errors saying that 'brothers_repeat_home_lodge.name' is an unknown column.
{thistable}.name," No. ",{thistable}.number

I have included a screenshot of the element configuration.

Thanks for the quick reply Hugh.
 

Attachments

  • 2013-01-24 11.02.30 am.png
    2013-01-24 11.02.30 am.png
    43.3 KB · Views: 351
So is 'brothers_repeat_home_lodge' the table this join element joins to? And should those fields exist on that table?

-- hugh
 
Yes, 'brothers_repeat_home_lodge' is the table that was created by the database joins element. It contains only the ids for the Brothers and the Lodges. It does not contain any other information. Frankly, I wouldn't know how to make the database join include additional information, though that might solve my problem. I laid out the tables and you can see their relationship in the image attached. I have also included an image of the three databases as seen in phpMyAdmin. Finally, I included an image of what the form and list views look like, the issue is most obvious here.

If you think that it would be easier, I can PM you a username and password for you to take a look. I'm very inexperienced with database joining and so it's sounding like that is the problem. However, it still seems weird to me that the concat (using the incorrect placeholders) works in the form view but not in the list view.
 

Attachments

  • table_overview.png
    table_overview.png
    62.7 KB · Views: 300
  • phpMyAdmin_Tables.png
    phpMyAdmin_Tables.png
    521.6 KB · Views: 290
  • formview_vs_listview.jpg
    formview_vs_listview.jpg
    137.8 KB · Views: 302
As a thought, I think that this is only a problem when the database join is rendered as a multi select dropdown. I'm not sure what that's worth but I was playing with another element as a database join and the problem only appeared once I changed its type from dropdown to multi select dropdown.
 
Yup this sounds like its because its rendering as a multiple select dropdown.

What you were expecting to happen is what should happen, it just wasn't working correctly.

I've had a go at fixing this one so if you update from github and try again with the same concat syntax, it should work:

Code:
[FONT=Verdana]{thistable}.name," No. ",{thistable}.number

-Rob
[/FONT]
 
I just updated and it seems to work like a champ. I will let you know if I think it acts up again.

Thanks for all you do.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top