?
avatar gaelicwinter
gaelicwinter
22 Sep 2017

Steps to reproduce the issue

  1. New 3.8.0 installation, no test data

  2. In Global Config, turn on maximum error messages

  3. Create a category, call it 'Test'

  4. Create custom field and assign it to the category 'Test'

  5. Go to Articles, set the list filter to filter on Category 'Test'

  6. Click New Article, get error

    Notice: Array to string conversion in C:\xampp7\htdocs\test\administrator\components\com_fields\helpers\fields.php on line 330

Expected result

Actual result

Error as stated

System information (as much as possible)

Both live Siteground host and local xampp.
PHP7
J3.8.0

Additional comments

The error happens because the Category Filter dropdown has changed to multiselect, so in my example, the field helper is given an array of cat id's instead of a single cat id to work with. The New Article form tries to load custom fields for the specified category but its now an array of one or more catid's instead of just a single catid.

My suggestion would be to check the incoming catid for an array and if found, to just use the first catid.

avatar gaelicwinter gaelicwinter - open - 22 Sep 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Sep 2017
avatar gaelicwinter gaelicwinter - change - 22 Sep 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-09-22 19:53:42
Closed_By gaelicwinter
avatar gaelicwinter gaelicwinter - close - 22 Sep 2017
avatar gaelicwinter
gaelicwinter - comment - 22 Sep 2017
	$assignedCatids = isset($data->catid) ? $data->catid : (isset($data->fieldscatid) ? $data->fieldscatid : $form->getValue('catid'));

	if(is_array($assignedCatids))
	{
		$assignedCatids = $assignedCatids[0];
	}
avatar gaelicwinter gaelicwinter - change - 22 Sep 2017
Status Closed New
Closed_Date 2017-09-22 19:53:42
Closed_By gaelicwinter
avatar gaelicwinter gaelicwinter - reopen - 22 Sep 2017
avatar gaelicwinter
gaelicwinter - comment - 22 Sep 2017

reopened

avatar ggppdk
ggppdk - comment - 22 Sep 2017

Same as #17974

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Sep 2017
Category com_fields
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Sep 2017
Status New Duplicate Report
Closed_Date 0000-00-00 00:00:00 2017-09-23 04:59:36
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 23 Sep 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 23 Sep 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 Sep 2017

closed as duplicated Report #17974. Thanks for Hint @ggppdk


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

Add a Comment

Login with GitHub to post a comment