• Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Element Eval Default Value not saved in DB

indyjoel

New Member
Hi
I have an element that I have set Eval to TRUE (the plug in type is DISPLAY)
I then use this code in the default section under Eval to set the value
$user =& JFactory::getUser();
$name = $user->get('name');
return $name;

When I select add to insert data from a list the Eval default value is shown on the screen so the code is working ok.

However when I press SAVE to store the data into the DB all other data that has been entered is ok but the element eval value is not.

I have tried setting the DB default value for the element to NULL this did not work. I also set it to not be NULL but it did not work.

Not sure where to go next.
 
A display element only displays, it doesn't store in the database.

So as you have already done, use Eval in another element :)

Or... maybe just use the user element?
 
Back
Top