Inlineedit plugin not processed by ./components/com_fabrik/helpers/html.php

Bauer

Well-Known Member
This is an example of the $file array sent to
public static function script($file, $onLoad = '', $minSuffix = '-min.js')
in ./components/com_fabrik/helpers/html.php
if a list contains the inlineedit plugin
per a dump of print_r($file,1)...
Code:
Array
(
    [Window] => media/com_fabrik/js/dist/window.js
    [FbList] => media/com_fabrik/js/dist/list.js
    [FbListFilter] => media/com_fabrik/js/dist/listfilter.js
    [ListPlugin] => media/com_fabrik/js/dist/list-plugin.js
    [FbListCaneditrow] => plugins/fabrik_list/caneditrow/caneditrow-min.js
    [FbListUpdate_col] => plugins/fabrik_list/update_col/update_col-min.js
    [FbListPhp] => plugins/fabrik_list/php/php-min.js
    [0] => Array
        (
            [FbListInlineedit] => plugins/fabrik_list/inlineedit/inlineedit-min.js
        )

    [1] => media/com_fabrik/js/element-min.js
    [list_260] => components/com_fabrik/js/list_260.js
)

As this array is processed in the "foreach ($files as &$file)" loop, it triggers php errors because (for the inlineedit plugin) an array is sent when calling calling stristr() at line 1395.

I found the bug - but I don't know the REAL solution (other than checking for an array in the loop and using the 1st element's value for $file).
PHP:
if(is_array($file)) $file = reset($file);
But that is just a hack. The REAL solution would be to fix Inlinedit plugin so it is not passing the min.js file name as an array. As you see, every other plugin is doing it right.

Below is the backtrace dump of the error, with the real culprit highlighted in bold...

Backtrace from warning 'mb_strtolower() expects parameter 1 to be string, array given' at /home/compcirc/public_html/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php 114:
/home/compcirc/public_html/index.php 49 calling execute()
/home/compcirc/public_html/libraries/cms/application/cms.php 257 calling doExecute()
/home/compcirc/public_html/libraries/cms/application/site.php 230 calling dispatch()
/home/compcirc/public_html/libraries/cms/application/site.php 191 calling renderComponent()
/home/compcirc/public_html/libraries/cms/component/helper.php 388 calling executeComponent()
/home/compcirc/public_html/libraries/cms/component/helper.php 413 calling require_once()
/home/compcirc/public_html/components/com_fabrik/fabrik.php 181 calling execute()
/home/compcirc/public_html/libraries/legacy/controller/legacy.php 728 calling display()
/home/compcirc/public_html/components/com_fabrik/controllers/list.php 93 calling get()
/home/compcirc/public_html/libraries/joomla/cache/controller/view.php 96 calling display()
/home/compcirc/public_html/components/com_fabrik/views/list/view.html.php 41 calling display()
/home/compcirc/public_html/components/com_fabrik/views/list/view.base.php 575 calling getManagementJS()
/home/compcirc/public_html/components/com_fabrik/views/list/view.base.php 316 calling script()
/home/compcirc/public_html/components/com_fabrik/helpers/html.php 1395 calling stristr()
/home/compcirc/public_html/libraries/vendor/joomla/string/src/StringHelper.php 503 calling utf8_stristr()
/home/compcirc/public_html/libraries/vendor/joomla/string/src/phputf8/stristr.php 24 calling utf8_strtolower()
/home/compcirc/public_html/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php 114 calling mb_strtolower()
 
Last edited:
I can't keep up! :D
(I'll have to send you an email explaining the day I had today (yesterday) - it's a hoot, now that it's over.)
 
Ok. I updated from github.

But I still get this message in the console...
online-survey-hospice?mfid=35&ftid=7:1651 Uncaught ReferenceError: FbListCanEditRow is not defined (anonymous function) @ online-survey-hospice?mfid=35&ftid=7:1651Element.Events.domready.onAdd @ mootools-core.js:176invoke.addEvent @ mootools-core.js:118(anonymous function) @ mootools-core.js:126addEvent @ mootools-more.js:17(anonymous function) @ online-survey-hospice?mfid=35&ftid=7:1643i.execCb @ require.js:29$.check @ require.js:18(anonymous function) @ require.js:23(anonymous function) @ require.js:8(anonymous function) @ require.js:23v @ require.js:7$.emit @ require.js:23$.check @ require.js:19(anonymous function) @ require.js:23(anonymous function) @ require.js:8(anonymous function) @ require.js:23v @ require.js:7$.emit @ require.js:23$.check @ require.js:19(anonymous function) @ require.js:23(anonymous function) @ require.js:8(anonymous function) @ require.js:23v @ require.js:7$.emit @ require.js:23$.check @ require.js:19$.enable @ require.js:23$.init @ require.js:17E @ require.js:14i.completeLoad @ require.js:28i.onScriptLoad @ require.js:29

It looks like there is some confusion between the use of FbListCanEditRow and FbListCaneditrow

Here is the way that same $list array loooks now...
Code:
Array
(
    [Window] => media/com_fabrik/js/dist/window.js
    [FbList] => media/com_fabrik/js/dist/list.js
    [FbListFilter] => media/com_fabrik/js/dist/listfilter.js
    [ListPlugin] => media/com_fabrik/js/dist/list-plugin.js
    [FbListCaneditrow] => plugins/fabrik_list/caneditrow/caneditrow-min.js
    [FbListUpdate_col] => plugins/fabrik_list/update_col/update_col-min.js
    [FbListPhp] => plugins/fabrik_list/php/php-min.js
    [FbListInlineedit] => plugins/fabrik_list/inlineedit/inlineedit-min.js
    [element] => media/com_fabrik/js/dist/element.js
    [list_260] => components/com_fabrik/js/list_260.js
)

I am totally fried and pretty much worthless today. But just thought I'd report that.
 

Attachments

  • caneditrownotdefined.png
    caneditrownotdefined.png
    62.3 KB · Views: 97
If I unpublish the caneeditrow plugin - I still get an error on the next one...
online-survey-hospice?mfid=35&ftid=7:1651 Uncaught ReferenceError: FbListUpdateCol is not defined

The function names referenced and the function names given are not the same.
 
Seems to be here
\plugins\fabrik_list\caneditrow\caneditrow.php line 27

class PlgFabrik_ListCaneditrow extends PlgFabrik_List

and here
\plugins\fabrik_list\update_col\update_col.php line 26

class PlgFabrik_ListUpdate_Col extends PlgFabrik_List
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top