Bug introduced in recent github?

Bauer

Well-Known Member
I have a form that included a joined repeat table with the 'Show group' option for the group containing the repeat table set to 'Always show as read only'. It worked fine until I updated from github this morning.

All elements that are using the databasejoin element plugin are no longer showing the labels for the element options. (Screen print attached). The labels are all empty (What you see in most of the elements on my screen print are just the bullets from the UL/LI list). I spent the entire day trying to fix it - but no luck.:(
 

Attachments

  • readonly_dbjoins.png
    readonly_dbjoins.png
    45.6 KB · Views: 226
A dbjoin (checkbox) in an "always readonly" group is showing fine on my site.

What is your exact setup?
dbjoin rendered as checkbox? or multiselect?
group with/without repeat?
Fabrik bootstrap template or a custom one?
anything else special?
 
The Members, States, and Job Classifications, Hospital Types, and Ownership Types are being rendered as multiselect dropdowns - the Regions rendered as checkboxes. Repeatable = Yes.

I'm using a customized bootstrap-tabbed template (that shows/hides the repeat groups by clicking the group header bar - that still works fine - see attachment.)
But before I even posted this - I tried using the default bootstrap template and had the same results. (see attachment)

Also attached is the bottom part of that same form/group. None of those elements are using datbasejoin. The Percentiles are using a dropdown element (as checkboxes) - the Stats and Pay Elements are using a checkbox element - and the Create Timestamp is a date element.

This is really weird because it worked fine until now. I'll play with it some more and see what I can come up with.
 

Attachments

  • breakout_bottom.png
    breakout_bottom.png
    35.1 KB · Views: 190
  • breakout_collapsed.png
    breakout_collapsed.png
    75.4 KB · Views: 202
  • breakout_bootstrap.png
    breakout_bootstrap.png
    21.2 KB · Views: 228
It must be my lucky day.
After I added a new row, the new repeat groupis showing correctly. (see attachment)
THAT is how the old one used to look.
But the old one is still the same.
I have no idea - maybe I trashed the '_repeat_' tables somehow? Or something was changed recently in the code and now it only works when the form is submitted with the new code?
Anyhow, I'll keep you abreast on any further problems, if any.
 

Attachments

  • readonlyOK.png
    readonlyOK.png
    72.2 KB · Views: 197
I spoke too soon.:( The bug remains.
The problem occurs after subsequent saves of the form - and gets worse after each save.
Attached are screen shots of how that 'fixed' new repeat group now looks after a few saves - as well as screen shots of a very basic test table I created. The problem as shown in my example screenshots is from a multi-select database join 'states" list that is being used in both the parent table and joined table (with different element names).
 

Attachments

  • broke_again.PNG
    broke_again.PNG
    64 KB · Views: 204
  • states1_per_repeat_allSelected.png
    states1_per_repeat_allSelected.png
    36.4 KB · Views: 199
  • states1_per_repeat_allSelected_RO.png
    states1_per_repeat_allSelected_RO.png
    27.5 KB · Views: 195
  • states1_per_repeat_RO_AfterEdit.png
    states1_per_repeat_RO_AfterEdit.png
    23.3 KB · Views: 213
To followup. I deleted all the database joins elements in those test tables - just because I know there are (or at least used to be) issues when you changed the rendering type (like from the default dropdown to multiselect) in a databasejoin element. Then I removed the actual table join from the list and recreated two new dboin elements again - one in each table, this time remembering to create them as multiselects right off - and then I recreated the join on the tables and tried my test again.

I now see what is happening - just no idea why. Have a look at the screenshots attached.
I didn't bother to look at the tables via phpMyAdmin until the 2nd save - but what happened when I changed the display/editing options for the repeat group from the normal "Yes" to "Always show as read only", the key values in the repeat table are replaced with sequential numbers (ignoring the parent_id) .

So the first time the form was saved, the 12 records in the repeat table had the 'repeat_states' values 1 through 12. On the 2nd save they changed to 13 through 24. And on the 3rd save they changed to 25 through 36. Only after I edited/saved the form enough times to get past the 51 options in the states list is when the option labels in the repeat group form started to show as blanks - because the keys they use didn't even exist in the 'states' table used by the database join element. That explains where the weird key values - up into the thousands - came from in the repeat tables in my actual development project. Because I was using a tabbed form - and working on testing a php form plugin script at that time - I didn't even notice this quirky bug in the repeats tab of the form until I had saved the form dozens of times.

I sure hope this can be fixed soon, because I was relying heavily on that 'Always show as read only' option to work. For security purposes, I want it so that there is no chance for a user to change or re-post those values in the repeat groups - as they are already literally bought and paid for and 'locked in' and cannot be changed.

As I have always suspected - and continues to be proven by events like this - there is a flaw in the dbjoin element when used in repeat groups that has existed for years now. One of these days I might actually figure it out, but this old man's brain power is deteriorating faster than an apple rotting at the bottom of a barrel - and it's times like this I just want to throw my hands in the air and retire from this fruitless, thankless, mad 'hobby' of mine once and for all.:confused:
 

Attachments

  • 2ndSave.png
    2ndSave.png
    67.3 KB · Views: 199
  • 3rdSave.png
    3rdSave.png
    67.5 KB · Views: 201
friendly bump !
Just trying to get some feedback on this since my last updated post. I'm 'on hold' with my project because of it.
 
Thanks Jaanus. I know you have been working at this - and would love to help and work with you on solving it.
I'll try that and let you know what I come up with.

One thing I did earlier this week was make the change regarding the missing 'repeatCounter' mentioned in this thread... http://fabrikar.com/forums/index.php?threads/databasejoin-issues.40346/. I was afraid to make changes to the other functions that call getLabelForValue() - i.e. uncertain which ones actually need to pass a repeatCounter?

But when I did that I got this in the php error log (I send a backtrace on error)...
Backtrace from warning 'Declaration of PlgFabrik_ElementTags::getLabelForValue()
should be compatible with PlgFabrik_ElementDatabasejoin::
getLabelForValue($v, $defaultLabel = NULL, $forceCheck = false, $repeatCounter = 0)'
at /home/public_html/plugins/fabrik_element/tags/tags.php 430:

I am having some health issues lately and spending a lot of time having tests - so haven't dived into that. But I wasn't even aware of this tags sub-class and had always been looking just in databasejoin.php to try to pinpoint the problem.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top