hidden field element not storing {$my->groups} consitently

Just wanted to check in and see if you all had any more ideas on what's happening? Is there a way around this? like keeping the cell visible but styling it so that it isn't?
 
I still have absolutely no idea why this is happening. I have a test case to which I've submitted dozens of forms, with no problems, and simply have no ideas at all about what could be happening.

So yes, try hiding it with CSS.

-- hugh
 
PS ... personally I wouldn't do this with a default at all, as I wouldn't want to expose that information in the form. I'd use a form submission script, with an ACL protected element, which grabbed the group memberships through the J! API and inserted them into the form data during the submission.

-- hugh
 
That sounds awesome and I would totally try it if I knew how. In any case, I'm not sure if this maybe gives you a different light on what's happening, Here is a shot of phpmyadmin and what it's storing.
missing-groups.JPG
 
What is that third column, "creator_", which appears to be the group names?

But no, that doesn't really help, as all it shows is some empty fields, which we already knew was the problem.

As for how to do it ... just create a form PHP plugin, running onBeforeProcess, and use something like this code ...

PHP:
$myUser = JFactory::getUser();
$myGroups = $myUser->getAuthorisedGroups();
$myGroups = implode(',', $myGroups);
$formModel->updateFormData('yourtable___creator_groups', $myGroups, true);

-- hugh
 
Note that doing it with a form plugin will also handle editing of records, so the group memberships will reflect those in force during the last edit, rather than just being set to those in force at creation. If that's not what you want, and you only want groups recorded at creation, you'd have to check to see if it's a new row or not - let me know.

-- hugh
 
The record of the groups would have to be the original creator. I'm going to dabble with this.

To answer your question about the third column, that's creator_name. names on my site follow this format: (profession) firstname lastname.

Thanks for helping where you can here.
 
Wish I could diagnose the issue with the Mysterious Missing Fields, but I just don't even have an inkling of what could be happening.

Play around with that code, let me know if you need help.

I think $formModel->isNewRecord() should tell you if it's ... well ... a new record. Although that uses getRowId(), which I seem to recall has developed some strange behavior of late, and doesn't always return what I'd expect it to.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top