Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[com_fields] Undefined property: stdClass::$assigned_cat_ids, com_fields #13565

Closed
anibalsanchez opened this issue Jan 11, 2017 · 7 comments
Closed

Comments

@anibalsanchez
Copy link
Contributor

anibalsanchez commented Jan 11, 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

@anibalsanchez anibalsanchez changed the title Notice: Undefined property: stdClass::$assigned_cat_ids, com_fields/helpers/fields.php on line 453 Undefined property: stdClass::$assigned_cat_ids, com_fields Jan 11, 2017
@Bakual
Copy link
Contributor

Bakual commented Jan 11, 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.

@Bakual Bakual changed the title Undefined property: stdClass::$assigned_cat_ids, com_fields [com_fields] Undefined property: stdClass::$assigned_cat_ids, com_fields Jan 11, 2017
@laoneo
Copy link
Member

laoneo commented Jan 12, 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?

@Bakual
Copy link
Contributor

Bakual commented Jan 12, 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.

@Bakual
Copy link
Contributor

Bakual commented Jan 12, 2017

See PR #13570

Closing this.

@Bakual Bakual closed this as completed Jan 12, 2017
@laoneo
Copy link
Member

laoneo commented Jan 12, 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.

@Bakual
Copy link
Contributor

Bakual commented Jan 12, 2017

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

@laoneo
Copy link
Member

laoneo commented Jan 12, 2017

That's what I wanted to say 🙊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants