?
avatar anibalsanchez
anibalsanchez
11 Jan 2017

Steps to reproduce the issue

  1. Define a field in Users
  2. Navigate to create or edit a user

Expected result

No notice

Actual result

Notice: Undefined property: stdClass::$assigned_cat_ids, com_fields/helpers/fields.php on line 453

System information (as much as possible)

Additional comments

avatar anibalsanchez anibalsanchez - open - 11 Jan 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Jan 2017
avatar anibalsanchez anibalsanchez - change - 11 Jan 2017
Title
Undefined property: stdClass::$assigned_cat_ids, com_fields
Notice: Undefined property: stdClass::$assigned_cat_ids, com_fields/helpers/fields.php on line 453
avatar anibalsanchez anibalsanchez - edited - 11 Jan 2017
avatar anibalsanchez anibalsanchez - change - 11 Jan 2017
The description was changed
Title
Notice: Undefined property: stdClass::$assigned_cat_ids, com_fields/helpers/fields.php on line 453
Undefined property: stdClass::$assigned_cat_ids, com_fields
avatar anibalsanchez anibalsanchez - change - 11 Jan 2017
The description was changed
avatar anibalsanchez anibalsanchez - edited - 11 Jan 2017
avatar Bakual
Bakual - comment - 11 Jan 2017

@laoneo That's because com_users doesn't use categories, right? The parameter is thus missing in the field definition as well.
I think I can make a PR tomorrow to deal with that.

avatar Bakual Bakual - change - 11 Jan 2017
Title
Notice: Undefined property: stdClass::$assigned_cat_ids, com_fields/helpers/fields.php on line 453
Undefined property: stdClass::$assigned_cat_ids, com_fields
avatar Bakual Bakual - edited - 11 Jan 2017
avatar laoneo
laoneo - comment - 12 Jan 2017

This issue reveals a problem when a component doesn't use categories for grouping. Correctly implemented, we need to offer for the component a way to define the hardcoded category_id more dynamically

I guess this would mean that we can't use the category form field here https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/models/forms/field.xml#L35. Instead of we need to make our own generic one. But I don't know if this is doable in a stable way?

avatar Bakual
Bakual - comment - 12 Jan 2017

The first one isn't an issue as $tupel->category_id refers to the #__fields_categories table. That will always be that column name ?

The other one may be an issue if an extension doesn't use catid as property. However it may also be possible for them to just copy the property to catid before it goes through fields. Otherwise we would need a way to alias the category property of an item. But it isn't the cause of the issue here.

The category field however is fine. That should work with all extensions using com_categories.

avatar Bakual
Bakual - comment - 12 Jan 2017

See PR #13570

Closing this.

avatar Bakual Bakual - change - 12 Jan 2017
The description was changed
Title
Undefined property: stdClass::$assigned_cat_ids, com_fields
[com_fields] Undefined property: stdClass::$assigned_cat_ids, com_fields
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-01-12 08:50:24
Closed_By Bakual
avatar Bakual Bakual - close - 12 Jan 2017
avatar laoneo
laoneo - comment - 12 Jan 2017

The category field however is fine. That should work with all extensions using com_categories.

Like it is now, it ONLY works for categories. It is not possible to assign fields to user groups or other component specific grouping items.

avatar Bakual
Bakual - comment - 12 Jan 2017

Ah sure, that isn't possible. But it's also not something which we tried to support so far.

avatar laoneo
laoneo - comment - 12 Jan 2017

That's what I wanted to say ?

Add a Comment

Login with GitHub to post a comment