'The' fix for inlineedit plugin bug

Status
Not open for further replies.

Bauer

Well-Known Member
I get these 2 errors in the php error log file when using the inlineedit plugin on a list.
  • 'Undefined property: FabrikFEModelFormInlineEdit::$tmpl' at /home/public_html/components/com_fabrik/models/forminlineedit.php 130:
  • 'Undefined property: FabrikFEModelFormInlineEdit::$tmpl' at /home/public_html/components/com_fabrik/models/forminlineedit.php 137:
This is another one of those cases where using @$varname causes a php error that is not likely to be noticed and fixed - and yet, in many cases, trashes the expected php results - creating a bug.

The offending code (one of 4) is...

$html[] = FabrikHelperHTML::image('delete.png', 'list', @$this->tmpl, array('alt' => FText::_('COM_FABRIK_CANCEL')));

The error occurs when $this->tmpl is undefined.
To fix it, I set a variable to be used instead of $this->tmpl - based on whether $this->tmpl is defined.
I haven't used github in so long, I don't have any idea how to change it there.
But here's the fix, if someone would PLEASE fix it at github?...

Add the line...
$thistmpl = isset($this->tmpl) ? $this->tmpl : '';
twice - at line 122 and line 178 (just above the if() condition that contains the offending @$this->tmpl code).

Then replace all (4) instances of @$this->tmpl with $thistmpl.

Finally, inlineedit works like charm.
 
Last edited:
thanks - indeed it was sloppy of us to be doing @.....
Thanks for the fix, I have now merged the PR
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top