1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice
  2. If you update to Joomla 3.9.16, you will have to update Fabrik from the latest GitHub version, to fix a bug introduced in Joomla, which makes it impossible to list front end folder locations in backend JForms. This affects things like template selection.
    Dismiss Notice

$row not including join elements on 'edit' button click

Discussion in 'Community' started by pastvne, Mar 25, 2020 at 3:14 PM.

  1. pastvne

    pastvne Bruce Decker

    Level: Community
    Hi All:
    I'm using the CanEditRow list plugin. the plugin needs to reference a field which is joined in the list. When the plug-in fires as the list is loading, $row contains all elements including the joins. But, when the 'edit' button is clicked, the plugin is again fired but this time the $row array does not contain the joined elements. This is causing the canEditRow custom PHP to return false because a referenced element is missing from the $row array and thus causing the code to return false.

    I could add logic to say that if the referenced element is missing then bypass the logic, but in general, I'd prefer to make the code consistent between the list load context and the edit-button-click context. Is there a trick that would allow the joined data to appear in the $row array in the edit-button-click context?
     
  2. pastvne

    pastvne Bruce Decker

    Level: Community
    Noting that this seems to occur when the setting on the group for the joined elements is set to 'nobody' access. When I moved to public, the $row contains the extended joined elements. However, I do not want the elements of that group on my form, I just need to reference them in the plug-in. I may need to restructure the query in my plug-in code to re-create the essence of the join so that I can always reference the required value unless there is a trick that allows me to hide on form but show in $row array during the click-on-edit-button context.
     
  3. pastvne

    pastvne Bruce Decker

    Level: Community
    Another observation, the $row array is an array of 1 row containing an object in the context when the list loads. But it is an array of 1 row containing another array (rather than an object) in the click-on-edit context. If I can find a way to hide the extended fields on the form but still have them in the click-on-edit button context, then I could code around the difference in array vs. object syntax and still have one set of code for both contexts. So, I think the real question is how do I hide the group for the joined elements on the form (without Javascript because there is sensitive data in the extended join that I don't want to expose to the browser), and still have it visible within the click-on-edit-button context?
     
  4. pastvne

    pastvne Bruce Decker

    Level: Community
    Continuing to document here in case this comes up for others....

    I think I have a solution now. Rather than set the group access to 'nobody', I instead should be editing the group->layout->show in form/details and set it to 'yes, but hidden'. Then I must change my join from a LEFT join to a INNER join to prevent the sensitive information from being exposed within the html source. I think this can work. Alternatively, my plug-in contains a query and I could just make the plug-in perform the join it its query. it would be a minor performance hit but would make the code consistent and secure between contexts. Still interested in any critique or advice as I learn. Thanks all!
     

Share This Page