?
avatar taantrik
taantrik
13 Dec 2014

Steps to reproduce the issue

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.

Expected result

Should pick-up related articles based on tags or keywords and show them in a list.

Actual result

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

System information (as much as possible)

ApacheFriends XAMPP Version 1.8.3

  • Apache 2.4.4
  • MySQL 5.5.32 (Community Server)
  • PHP 5.5.11 (VC11 X86 32bit thread safe) + PEAR
  • phpMyAdmin 4.0.4

Also tested on live apache server. Same results.

Additional comments

Kindly see if this can help : Helper for mod_related_items : line 42
After: $option = $app->input->get('option');
$view = $app->input->get('view');
Here:
$temp = $app->input->getString('id');
$temp = explode(':', $temp);

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
3.50

avatar taantrik taantrik - open - 13 Dec 2014
avatar taantrik taantrik - change - 13 Dec 2014
The description was changed
avatar taantrik taantrik - change - 13 Dec 2014
Title
Module "Articles - Related Articles" shows Notice error : Array to string conversion
Module "Articles - Related Articles" shows Notice error : Array to string conversion
avatar taantrik taantrik - change - 14 Dec 2014
The description was changed
avatar taantrik taantrik - change - 14 Dec 2014
The description was changed
avatar taantrik taantrik - change - 14 Dec 2014
The description was changed
avatar brianteeman brianteeman - change - 3 Jan 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 1 Feb 2015

@test issue confirmed when display errors is set to maximum

Dont understand what you are saying in Additional Comments as there is no change suggested


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5418.
avatar brianteeman brianteeman - change - 1 Feb 2015
Status New Confirmed
avatar taantrik
taantrik - comment - 3 Feb 2015

Hi, I'm not a tech or programmer so don't know what should be changed. I assumed that this line of code might be helpful in finding out the problem.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5418.
avatar matrikular
matrikular - comment - 14 Mar 2015

I cannot reproduce this bug.

avatar Harmageddon
Harmageddon - comment - 14 Mar 2015

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5418.
avatar hvdmeer
hvdmeer - comment - 12 Dec 2015

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"


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5418.

avatar bertmert
bertmert - comment - 12 Dec 2015

@hvdmeer
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.)

avatar brianteeman
brianteeman - comment - 28 Jan 2016

@bertmert I an reproduce this on Joomla 3.5 beta 2
I added your suggested line to the module and it appears to resolve the issue


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5418.

avatar pe7er
pe7er - comment - 24 Mar 2016

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!

avatar joomdonation
joomdonation - comment - 24 Mar 2016

@pe7er I think the fix you are talking about was fixed in this PR #9519

avatar pe7er
pe7er - comment - 24 Mar 2016

@joomdonation Yes, that's right. Thanks!

avatar brianteeman
brianteeman - comment - 24 Mar 2016

Closing as resolved in #9519

avatar brianteeman brianteeman - change - 24 Mar 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-03-24 10:27:52
Closed_By brianteeman
avatar brianteeman brianteeman - close - 24 Mar 2016

Add a Comment

Login with GitHub to post a comment