User tests: Successful: Unsuccessful:
just a little modification to make it consistent with filter.category_id in getListQuery method
use a module that uses the backend model with several categories
there shouldn't be any notice
there is a notice
Notice: Array to string conversion in /administrator/components/com_contact/models/contacts.php on line 134
joomla staging branch
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
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Title |
|
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();
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'));
Category | ⇒ | Administration Components |
I have tested this item
Notice before patch, no notice after patch.
Category | Administration Components | ⇒ | Administration com_contact com_content Components |
@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.
i fixed the indentation
@icampus
could you please add a Test Instructions?
Status | Pending | ⇒ | Information Required |
I have tested this item
Tested:
Filtered in com_contact Cantacts view for multiple categories.
Without patch:
Said notices appear.
With patch:
No notices appear.
@icampus
could you please add more detailed Test Instructions?
I have tested this item
Solves the Array to string conversion notice after applying patch.
Status | Information Required | ⇒ | Ready to Commit |
@franz-wohlkoenig please keep off the RTC label until we have conflicting files and travis or drone errors.
will do and hopefully not forget to set RTC later.
Labels |
Added:
Conflicting Files
?
|
Category | Administration Components com_contact com_content | ⇒ | Administration com_contact Components |
@franz-wohlkoenig sorry for delay, i merged staging.
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
|
@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 ;)