Create a new Module "Articles - Related Articles" and publish.
Create a menu link with menu Item type = "tagged items" and than select one or more tags and publish.
Assign the newly created menu item to newly made Module or vice-versa.
Visit the newly created menu.
Should pick-up related articles based on tags or keywords and show them in a list.
These error generated on the pages where $option is com_tags and/or $view is "tag"/ or "tags" instead of showing the module:
Notice: Array to string conversion in \libraries\joomla\filter\input.php on line 202
Notice: Array to string conversion in \libraries\joomla\filter\input.php on line 242
ApacheFriends XAMPP Version 1.8.3
Also tested on live apache server. Same results.
Kindly see if this can help : Helper for mod_related_items : line 42
After: $option = $app->input->get('option');
$view = $app->input->get('view');
$temp = $app->input->getString('id');
$temp = explode(':', $temp);
No Code Attached Yet
I can reproduce it with the given instructions and digged a little bit deeper here. The problem is (once again) the way how com_tags represents its menu options for routing etc.
The related items module uses the JModuleHelper::cache method to cache its contents. Therefor, a unique value to identify every page has to be generated. Amongst others, the id of the displayed content is used here (because it is part of the menu item), e.g. an article id if you look at a single article. Com_tags does not represent the id as an integer value like every other component, but as an array, because you can list items from more than one tag in one menu item. Same goes for the content types, they are also represented as an array. The function that is used to generate an unique identifier for each page, in libraries/cms/module/helper.php#L506, converts every input value to a string, which is problematic for arrays.
My approach to fix this would be to serialise all values that can't be safely converted to strings in the helper.php file, but I'm not very familiar with caching (and maybe routing, too), so I'd appreciate to hear some other opinions.
Tested this issue on the joomlapbf-server and used the example data for it. After setting up the module, adding the menu link I only get a error when visiting the menu link:
"Fatal error: Call to a member function setState() on a non-object in /.../public_html/nl/joomla14/modules/mod_related_items/helper.php on line 44"
Which Joomla version?
If you can reproduce this error could you please add the following line
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models', 'ContentModel');
after this line (12)
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
and try again?
(But it's not related to this issue. Would be a new one.)
I was able to reproduce this bug on Joomla 3.5.0 stable when I activated Joomla's default Search Module, on PHP Version 5.4.45 with Error Reporting set to "System Default"
I've tested it on a local system on Joomla 3.4.8 on PHP 5.6.17 with Error Reporting set to "System Default", and could not reproduce it on J 3.4.8. After I updated that site to Joomla 3.5.0 the error also occurred on that site.
After applying the suggestion of @bertmert in /modules/mod_related_items/helper.php
the error was gone.
Could you please create a PR for this? Thanks!
|Closed_Date||0000-00-00 00:00:00||⇒||2016-03-24 10:27:52|