? Success

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
6 Dec 2016

Regression from PR #13019.

Summary of Changes

This PR adapts the show custom fields setting in contacts to the new field groups.

Testing Instructions

  • Go to Users -> Field Groups
  • Create two Groups with the name Demo1 and Demo2
  • Go to Users -> Fields
  • Create a field with the Title Demo Field 1 and assign it to the field group Demo1
  • Create a field with the Title Demo Field 2 and assign it to the field group Demo2
  • Create a field with the Title Demo Field and assign it to no field group
  • Edit the super admin user and set some custom fields values
  • Go to Components -> Contacts
  • Open the options of the contacts component and select Demo1 in the parameter "Show User Custom Fields"
  • Create a new contact and link it to the super admin user
  • Create a new menu item for a single contact
  • On the front open the new contact menu item

Expected result

Only the values from the fields "Demo Field 1" and "Demo Field" should be shown.

Actual result

The groups are not shown on the back end Contact options and on the front is the following warning displayed:

Notice: Undefined property: stdClass::$catid in /joomla-cms/components/com_contact/views/contact/tmpl/default_user_custom_fields.php on line 24

avatar laoneo laoneo - open - 6 Dec 2016
avatar laoneo laoneo - change - 6 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Dec 2016
Category Administration com_contact Front End Templates (site)
avatar Bakual Bakual - change - 6 Dec 2016
Milestone Added:
avatar Bakual
Bakual - comment - 6 Dec 2016

Is it expected that fields which belong to no group are shown as well when I select only "Group2"? Seems a bit counter-intuitive to me.

avatar laoneo
laoneo - comment - 6 Dec 2016

Guess it is time to define what happens with fields which do not belong to a group. IMO they should be displayed. No group means for me that it belongs to all groups.

avatar Bakual
Bakual - comment - 6 Dec 2016

The tooltip indicates something else.
Also when nothing is selected, no fields are shown (as expected), but when I add a single group, actually two groups are shown. That's a bit unexpected to me.

avatar laoneo
laoneo - comment - 6 Dec 2016

Which tooltip are you talking about?

avatar Bakual
Bakual - comment - 6 Dec 2016

The one from the com_contact option
tooltip

avatar brianteeman
brianteeman - comment - 6 Dec 2016

There is the default group called fields if you dont put a field in a named group

avatar laoneo
laoneo - comment - 7 Dec 2016

So if a field belongs to no group, should it be displayed or not? Current implementation is, it will be displayed as for me a field which doesn't belong to a group, it is some kind of in all groups (it starts to become strange as I'm typing this phrase). But I'm fine with whatever makes more sense.

avatar Bakual
Bakual - comment - 7 Dec 2016

What I expect is if I select only one group, only the fields of that group should show.
If I select "All", it should also show the ones without any group.

avatar laoneo
laoneo - comment - 9 Dec 2016

Done

avatar Bakual
Bakual - comment - 9 Dec 2016

Thanks. 👍

avatar brianteeman
brianteeman - comment - 9 Dec 2016

Imho only fields from the selected group should be shown.

MY view is
if you select ALL then all fields should display
if you select GROUP1 then only fields in that group should display

The problem comes with fields that are not in a group (these are my generic fields).

So for example I have GROUP1, GROUP2 and some fields not in a group. How would I display the fields that are not in a group and GROUP1 but not GROUP2

avatar laoneo
laoneo - comment - 9 Dec 2016

We can add another option to select like "No grouped fields", maybe, not sure, hmmm.

avatar brianteeman
brianteeman - comment - 9 Dec 2016

Or maybe we require fields to be in a groups just as we require articles etc to be in categories

avatar Bakual
Bakual - comment - 9 Dec 2016

We could require the group. Or we could just say if you want to show those non-grouped fields here, create a group and group them
Adding an option for not grouped fields imho only asks for troubles. It complicates the code and it's also not that simple to find a good option name.

avatar laoneo
laoneo - comment - 9 Dec 2016

Or we could just say if you want to show those non-grouped fields here, create a group and group them

Sometimes the answer is so easy. I would go that way.

avatar laoneo
laoneo - comment - 9 Dec 2016

Changed code to show only fields of the selected groups.

avatar ralain
ralain - comment - 15 Dec 2016

I have tested this item successfully on 5b3ee16

Notice is gone, and specific field groups can be selected in com_contact options in addition to "All".


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

avatar ralain ralain - test_item - 15 Dec 2016 - Tested successfully
avatar jeckodevelopment
jeckodevelopment - comment - 16 Dec 2016

@laoneo could you please look at the conflicts?

avatar anibalsanchez
anibalsanchez - comment - 18 Dec 2016

Yes, I tested successfully most of the cases. Users and Contacts with several Field Groups and Fields (including fields with no group).

.... But "Show User Custom Fields" only shows All... What am I missing?


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

avatar laoneo
laoneo - comment - 18 Dec 2016

You can control which user custom fields should be shown on the contact view on the front end based on the field groups.

avatar anibalsanchez
anibalsanchez - comment - 18 Dec 2016

Yes, I know... but it only allows to select "All"

avatar anibalsanchez
anibalsanchez - comment - 18 Dec 2016

test-all

avatar laoneo
laoneo - comment - 18 Dec 2016

Did you create some User (not contact) field groups? I assume you have the latest staging checked out.

avatar anibalsanchez
anibalsanchez - comment - 18 Dec 2016

Yep, I created Field Groups and Fields in Users and Contacts. They work perfectly well.

Which is the method that populates this field?

avatar laoneo
laoneo - comment - 19 Dec 2016

@jeckodevelopment done. Can you please test it, would be great to have it in the first alpha?

avatar laoneo
laoneo - comment - 19 Dec 2016

@anibalsanchez I guess I found the issue. Because of PR #13175 the identifier changed from extension to context. I'v fixed it in my last commit. Now it should work again as expected.

avatar anibalsanchez
anibalsanchez - comment - 19 Dec 2016

@laoneo The query in JFormFieldFieldgroups requires an extension parameter. But, it is not defined in config.xml.

I've just added this line and it works OK:

extension="com_users"
avatar laoneo
laoneo - comment - 19 Dec 2016

It depends in the status of your branch. If yoi have the most actual code with #13175 which was merged recently then you need the context variable. If it is older, them you need the extension one. Anyway please mark it as successfull test. Thanks.

avatar anibalsanchez
anibalsanchez - comment - 19 Dec 2016

I have tested this item successfully on 2b71bd8

Test OK!


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

avatar anibalsanchez anibalsanchez - test_item - 19 Dec 2016 - Tested successfully
avatar ralain
ralain - comment - 19 Dec 2016

I have tested this item successfully on 2b71bd8

Test still good.


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

avatar ralain ralain - test_item - 19 Dec 2016 - Tested successfully
avatar jeckodevelopment jeckodevelopment - change - 19 Dec 2016
Status Pending Ready to Commit
avatar jeckodevelopment
jeckodevelopment - comment - 19 Dec 2016

RTC


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

avatar rdeutz rdeutz - reference | 00eefd1 - 21 Dec 16
avatar rdeutz rdeutz - merge - 21 Dec 2016
avatar rdeutz rdeutz - change - 21 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-21 11:42:35
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 21 Dec 2016
avatar rdeutz rdeutz - merge - 21 Dec 2016
avatar rdeutz rdeutz - close - 21 Dec 2016
avatar laoneo laoneo - head_ref_deleted - 21 Dec 2016
avatar cpfeifer cpfeifer - reference | fb3e6ba - 22 Dec 16

Add a Comment

Login with GitHub to post a comment