Hello,
In my site form, people can publish articles when they are not connected and some people have user name and code.
When user connected publish an article, the field art_catid is visible and configured by default on value 38. But they can change the catid.
When people are not connected, the field art_catid is not visible and I would like the catid automatically filled with value '11'.
--> In the site form in admin, the field catid is in restricted access only for connected people. BUT then, when not connected people publish an article the field catid is empty...
I tried to solve this with an "after (or before?) store field with this code :
$username = JFactory::getUser()->name;
if ( ($config['isNew']) || ($username !='name-connected') ) {
$name = $fields['art_catid']->storage_field;
$table = $fields['art_catid']->storage_table;
$new_value = '11';
$config['storages'][$table][$name] = $new_value;
$fields['art_catid']->value = $new_value;
}
but nothing happens... Would you know how I could do this ?
Thanks !!