Issues with labels

Bauer

Well-Known Member
1. Databasejoin elements that use a concat label are displaying the text part of that label when the element is empty (in both the details view and list view).

e.g. In detail117_30.png note that the databasejoin element - ?Included Breakouts? (see dbjoin_concat_label.png for concat value used) - is displaying ?(ID# )? in a details view if the databasejoin returns zero results. (Ditto for the list view.)

2. In details view the CascadingDropDown elements are showing the values as an enabled checkbox with the label ?dummy?. (The list view is displaying correctly)

e.g. In detail117_30.png note the cascadingdropdown element ?Addendum Facility/Survey Types?.

dbjoin_concat_label.pngdetails117_30.pngform117_30.png
 
dbjon concat: did you select "Trim empty concats" in "Advanced"?

CDD: confirmed(but no idea why; the form it showing a vanishing "dummy" on load, too)
Is it a CDD watching a CDD?
 
dbjon concat: did you select "Trim empty concats" in "Advanced"?

CDD: confirmed(but no idea why; the form it showing a vanishing "dummy" on load, too)
Is it a CDD watching a CDD?
Thanks for the quick reply, troester.

No, #1 is just a DBJ element. There is only one CDD element in the form.

Setting "Trim empty concats" to "Yes" fixes it in the list view but not in the details view. (And shouldn't "Trim empty concats" be set to "Yes" by the default? - Or for that matter why is that option even there? When would you ever not want to do that?)

As for #2 - I've noticed that 'dummy' checkbox comes up while the Ajax spinner is active - since github updates over the past week or so.

There are also now instances where 'unknown label' or 'undefined' is being inserted as a label (rather than a blank) and left in place in details forms. Once I can remember where that was happening, and just what type(s) of element, I'll start a new tread. (But I'm almost certain that was in a dbjoin element too.)

PS. Did you see this thread I started yesterday? - it sounds like the issues are related. http://fabrikar.com/forums/index.ph...on-not-triggered-on-cascading-dropdown.40948/
 
The empty concat in detail view should be fixed:

https://github.com/Fabrik/fabrik/commit/594948c00c76889ea1997128da5ad76d22dd8629

I can't remember offhand why we needed to add that dummy checkbox in the CDD, I think it's something to do with creating the basic DOM structure which we then modify when updating it when the CDD changes. There has to be a skeleton in place we then add / remove options from. I'm just not sure whey it's suddenly starting showing, unless it was this commit:

https://github.com/Fabrik/fabrik/commit/4fa7d6dcd372bf920fe00241cdc7a54aabb0366c

... which would have been stripping some tags out in checkbox mode till now

But it's tired and I'm late, I'll have another look "tomorrow".

-- hugh
 
Oh, and the reason we have the 'trim empty concats' option is when we first started just trimming them regardless, within hours we had people complaining that they didn't want that behavior, and wanted the constants in their concats to remain unmolested. One person's "why would you ever want to do it that way?" is another person's "I absolutely have to do it this way!"

As for which way we defaulted it, that's usually down to backward compat, so new behaviors don't just happen, you have to enable them. Although in this case it was probably entirely arbitrary, and one could make a case for defaulting either way. One thing is certain though - if I changed the default now, real soon I'd get someone complaining that it was defaulting to Yes. :)

-- hugh
 
re. Trim empty concats... I imagined there was a 'hysterical' (historical) reason for the trim empty concats option. No problem, I was just curious and you answered my question. Thanks!
 
I finally have my cascading dropdown working the way I wanted ? and my brain is fried, but I?ll give this explanation of the issues a try.

My CDD element is using a repeat table from the same dbjoin (facility types) element it uses as the ?watch? element - and uses a mySql SELECT statement in the label CONCAT to create the label ( per suggestions made in a few threads I found in this support forum, Thank You!).

That repeat table contains ?facility types? that are children or ?addendums? of (some of the) facility types. Because I wanted to keep the other 'addendum' facilities all in one table for easier editing (setting prices, etc) of all these ?facility types?, parent or child ? I wrote an admin frontend form to allow editing of most elements and flagging some of them as ?addendum? children facilities (added to a repeat group). And that form works fine, thanks to the fabrik Inline edit plugin (see facility_types.png).

When I moved on to creating a CCD to handle those parent and addendum children facilities for selection in other related forms, everything seemed to work fine too - EXCEPT that in list view the label for one of the selections was always repeated (if checked). See attachments.

If I checked only ?Hospital Management? - or ?Home Based Care / Services? ? or ?Hospital Management? and ?Home Based Care / Services? - it worked fine. But whenever ?Physicians? was selected it always displayed ?Physicians? twice.
It took me all morning to figure this out ? but I finally realized why, duhh. This repeat table I am using for the CCD list of ?child? addendum facility types could (does) have multiple rows using the same parent_id (facilty type) ? and so when the list view is created the query was including those repeats.

Anyhow, to make a long story ?less long?:D ? the query created by the CCD element for the list needed a ?DISTINCT? added to it to compensate for when the CCD might be using a repeat group table.

So I searched and found where to put this. Change line 1008 of cascadingdropdown.php from
return 'CONCAT_WS(\'\', ' . $val . ')';
to
return 'DISTINCT CONCAT_WS(\'\', ' . $val . ')';

and now all is well with the list - but form javascript crashes!

I'm sure this is an easy fix for me - I just haven't found it yet.
 

Attachments

  • watch_table.png
    watch_table.png
    36.9 KB · Views: 160
  • ccd_form.png
    ccd_form.png
    8.3 KB · Views: 161
  • ccd_list.png
    ccd_list.png
    26.4 KB · Views: 156
  • form_repeat_table.png
    form_repeat_table.png
    22.5 KB · Views: 160
  • facility_types_admin.png
    facility_types_admin.png
    45.8 KB · Views: 155
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top