Php error message evaluating a list

Status
Not open for further replies.

koze85

Member
hi
I have a list and I want to show the edit button only to the user that had created the record
SO in the list plugins I added the caneditrow and I added an advanced php eval

$user = JFactory::getUser();


if ('{linklist___usr}' == $user->username) {


return true;


}else{


return false;
}
While everything is working correctly as it should (Users can see only the edit button for the records they have created) I always get an error msg
An error has occurred with a eval'd field - please inform the web-site owner.
Debug: Caught exception on eval in can edit row : syntax error, unexpected BOOL_TRUE in Unknown on line 17
 
I know this works.......

Code:
$result = '{linklist___usr}' == {$my->username};
 
return $result;
 
Nope same think everything is shown correctly as it should but I get an joomla error message An error has occurred with a eval'd field - please inform the web-site owner.
Debug: Caught exception on eval in can edit row : Use of undefined constant koze - assumed 'koze'

koze is the username...

Thank you
 
then perhaps you need to do this.....

Code:
$result = '{linklist___usr}' == '{$my->username}';
 
return $result;

You might also want to check your debug settings in joomla, and choose "Joomla default". Perhaps your debug settings are too strict.

Fabrik outputs debug messages that are not critical, but rather warnings.
 
Strange... Joomla debug was at Joomla Default but Fabrik debug was set by me to JS only... yet It was outputting a php joomla "error" message !
Anyway Thanks a lot ! solved
 
If you are using the JUser object then accessing its properties should be done as follows:

PHP:
$username = $user->get('username');
That might have been the sisue.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top