? Success

User tests: Successful: Unsuccessful:

avatar julienV
julienV
3 Aug 2015

just a little modification to make it consistent with filter.category_id in getListQuery method


Steps to reproduce the issue

use a module that uses the backend model with several categories

Expected result

there shouldn't be any notice

Actual result

there is a notice
Notice: Array to string conversion in /administrator/components/com_contact/models/contacts.php on line 134

System information (as much as possible)

joomla staging branch

Additional comments

it's just a samll inconsistency in backend models contact.
The filter category_id is expected to be a numeric or an array in getListQuery function, but the store id function assumes it's a string.
hence, setting the filter to an array triggers a warning:

Notice: Array to string conversion in /administrator/components/com_contact/models/contacts.php on line 134

avatar julienV julienV - open - 3 Aug 2015
avatar julienV julienV - change - 3 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 3 Aug 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 3 Aug 2015
Title
fixes issue #7618 contacts model filter inconsistency
Fix Array to string conversion in Admin Contacts Modal
avatar zero-24
zero-24 - comment - 3 Aug 2015

@julienV can you give us some example code? If this is a real issue we need to fix it also for other models e.g. article ;)

avatar julienV
julienV - comment - 3 Aug 2015

you are right, it's the same in articles model indeed...

it happens if you try to reuse the model, in a 3rd party module for example:
$model = JModelLegacy::getInstance('Contacts', 'ContactModel', array('ignore_request' => true));
$model->setState('filter.category_id', array(1, 2 ,3));
$result = $model->getItems();

avatar julienV
julienV - comment - 3 Aug 2015

the goal of the getStoreId function is to cache same requests, so another solution could be to generalize the string contruction like this too:
$id .= serialize($this->getState('filter.category_id'));

avatar zero-24 zero-24 - change - 3 Aug 2015
Category Administration Components
avatar euismod2336 euismod2336 - test_item - 4 Nov 2016 - Tested successfully
avatar euismod2336
euismod2336 - comment - 4 Nov 2016

I have tested this item successfully on 3e49ad7

Notice before patch, no notice after patch.


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

avatar marrouchi
marrouchi - comment - 23 Jan 2017

@julienV I would recommend using serialize() like in BannersModelBanners (@Package Joomla.Site).

Also, it appears that we have the same issue in ContentModelArticles and BannersModelBanners (@Package Joomla.Administrator) models.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 11 Mar 2017

@julienV can you please give Test Instructions?

avatar jeckodevelopment
jeckodevelopment - comment - 12 Mar 2017

@julienV please look at the conflicting file

avatar julienV julienV - change - 13 Mar 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - change - 13 Mar 2017
Category Administration Components Administration com_contact com_content Components
avatar julienV
julienV - comment - 13 Mar 2017

@jeckodevelopment i updated the push, and followed the recommandations of @marrouchi to use serialize as it's shorter and covers all situation. And indeed, there was the same issue with content model as well.

avatar julienV
julienV - comment - 24 Jul 2017

i fixed the indentation

avatar Schmidie64
Schmidie64 - comment - 22 Aug 2017

@icampus
could you please add a Test Instructions?


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Aug 2017
The description was changed
Status Pending Information Required
avatar joomla-cms-bot joomla-cms-bot - edited - 22 Aug 2017
avatar SamuelSchepp SamuelSchepp - test_item - 22 Aug 2017 - Tested successfully
avatar SamuelSchepp
SamuelSchepp - comment - 22 Aug 2017

I have tested this item successfully on 5c9f983

Tested:
Filtered in com_contact Cantacts view for multiple categories.

Without patch:
Said notices appear.

With patch:
No notices appear.

@icampus


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/7619.
avatar Heggi93
Heggi93 - comment - 22 Aug 2017

@icampus
could you please add more detailed Test Instructions?


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

avatar sanderpotjer sanderpotjer - test_item - 30 Aug 2017 - Tested successfully
avatar sanderpotjer
sanderpotjer - comment - 30 Aug 2017

I have tested this item successfully on 5c9f983

Solves the Array to string conversion notice after applying patch.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 31 Aug 2017
Status Information Required Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 31 Aug 2017

RTC after two successful tests. @julienV please resolve conflicting Files.

avatar zero-24
zero-24 - comment - 31 Aug 2017

@franz-wohlkoenig please keep off the RTC label until we have conflicting files and travis or drone errors.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 31 Aug 2017

will do and hopefully not forget to set RTC later.

avatar zero-24
zero-24 - comment - 31 Aug 2017

?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Oct 2017

@julienV can you please resolve conflicting Files?

avatar julienV julienV - change - 5 Nov 2017
Labels Added: Conflicting Files ?
avatar joomla-cms-bot joomla-cms-bot - change - 5 Nov 2017
Category Administration Components com_contact com_content Administration com_contact Components
avatar julienV
julienV - comment - 5 Nov 2017

@franz-wohlkoenig sorry for delay, i merged staging.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Nov 2017

Thanks @julienV

avatar mbabker mbabker - close - 18 Nov 2017
avatar mbabker mbabker - merge - 18 Nov 2017
avatar mbabker mbabker - change - 18 Nov 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-11-18 15:59:10
Closed_By mbabker
Labels Removed: Conflicting Files

Add a Comment

Login with GitHub to post a comment