Support » Plugin: amr users » Adding a grouping breaks a list

  • Resolved linds

    (@lsterling03)


    I am using AMR Users v4.26 and AMR Users Plus Groupings 2.0. My groupings are no longer working. When I assign a grouping for a list (for example: School Division), the values for that field “erase” and the grouping row is empty. If I return the grouping to “none” that field (School Division) is correctly populated by the meta value. I have confirmed that I have rebuilt the cache before checking the list. And I have confirmed it’s not just a CSS issue hiding the field.

    Do you know what could cause this? Is AMR Plus Groupings still an active plugin, or do I need to use AMR Plus now? I can’t find what the current version of AMR Plus Groupings is. Has there been an update that I have missed?

    Thanks for any insight!

    • This topic was modified 7 months ago by  linds.
Viewing 10 replies - 1 through 10 (of 10 total)
  • linds

    (@lsterling03)

    A little update — it seems to be somehow related to rebuilding the cache. I played around with switching the grouping field to different fields and at one point, when I switched it back to my desired grouping field “School Divison” — it suddenly worked again! But then when I clicked to rebuild the cache, the groupings disappeared again.

    I was able to get it to return again by doing the following:

    1. Add a new field to the list (in this case, Zip Code).
    2. Switch the grouping to this new field, Zip Code.
    3. Rebuild the cache.
    4. Remove the zip code field from the list.
    5. Switch the grouping back to the desired grouping field, School Division.

    As long as I don’t rebuild the cache, the groups remain.

    And, to clarify, when the grouping is “broken” it shows up as a single dash at the top of the list. It’s not creating groups throughout the list, but rather just one that group row at the very top, with no value other than a dash. This happens no matter what field I choose as the grouping field.

    • This reply was modified 7 months ago by  linds.
    linds

    (@lsterling03)

    Update. So it *appeared* that the above temporarily fixed it, but I just realized the groupings are wrong. Step 5 changed the headings to the correct School Divisions, but rather than put all the users under each group, it repeats groups with different users. So, for example, Group 1 will list a group of users, then later on down the page, it will show Group 1 heading again with different users. And so on… So it’s not grouping ALL “Group 1” users together in one list, but rather breaking them up. I would think rebuilding the cache would fix that, but doing that breaking the groups entirely. So I’m back to square 1. This affects both frontend and backend view of the list.

    I have deactivated all plugins and my theme, with no change. Here are my stats.
    Do you see any problems?

    Plugin version: 4.26
    Php version: 5.6.33-0+deb8u1
    Wp version: 4.9.9
    Php maximum execution time is: <– it’s not 0, not sure why it says that?
    Wordpress Memory limit: 256M
    Wordpress Max Memory limit: 512M
    Php Memory Limit: 512M
    Charset: UTF-8

    At debug only: At 0.041 seconds, peak mem= 25.5 mb real_mem=25.5 mb

    Queried user meta master:16200
    At debug only: At 0.156 seconds, peak mem= 52.5 mb real_mem=52.5 mb

    • This reply was modified 7 months ago by  linds.
    • This reply was modified 7 months ago by  linds.
    linds

    (@lsterling03)

    I don’t know if this helps, but I found a commented-out debug line in the amr plus groupings code, so I uncommented it, which echo’ed this:

    w= c=dbem_school_division
    w=John c=first_name John
    w=Jones c=last_name Jones
    w=C&E ’18 c=CERTIFICATION_TYPE_DATE C&E ’18
    w=6 c=dbem_region 6
    w= c=dbem_school_division
    w=Sally c=first_name Sally
    w=Good c=last_name Good
    w=Economics ’17 c=CERTIFICATION_TYPE_DATE Economics ’17
    w=6 c=dbem_region 6

    The ‘dbem_school_division’ has no value above, but that field/value is not empty in the database. I can see that field correctly populated in amr lists, as long as it is not set as the grouping field. The “dbem_school_division” field is a select dropdown box, if that matters.

    I have 4,051 total WP users. The list example above only has to display 23 users, so it shouldn’t be too memory intensive to group them.

    I’ve increased the WP memory to 512MB. I have confirmed the max execution time is set to 300. It seems like the database/server is ok. No errors in the debug log. I’m stumped.

    If anyone has experienced anything similar, I’d love your insight!

    • This reply was modified 7 months ago by  linds.
    linds

    (@lsterling03)

    I’m sorry for adding a million posts to this thread! But I wanted to update the steps required to “fix” this (temporarily). This is a revision to my second post with Steps 1-5, which is much simpler:

    This is how I can fix the missing groups:

    1. Set the Grouping to “none”.
    2. Rebuild the list cache
    3. Set the grouping back to my desired field (dbem_school_division).

    In this case the groups are correct (not broken up as I described in my third post). BUT, as soon as I rebuild the cache, it breaks again. Meaning: no grouping, just a single dash at the top of the list.

    I have turned off my schedule twice-daily caching for now, until we figure out what is going wrong. I apologize if this is not the place to discuss amr groupings. I have an active license for support, but could not find an email address to write you directly.

    Plugin Author anmari

    (@anmari)

    Hi Linds, thanks for your updates. To contact me directly, you can always reply to the purchase receipt email.

    I’ll look into it. I am in the process of testing a big update that totally removes the cacheing, and this also reducing load on system, multiple test reports can be kept etc. A lot of stable code is being ‘touched’ which is always scary, so every add-on is being revisited and rested too.

    Plugin Author anmari

    (@anmari)

    Hi Linds, please also check whether the field that you have chosen for grouping actually has data for ALL your records. You can check two ways:

    • in admin.php?page=nice-names&tab=metakeys, there is a total next to the meta-key – check it matches the number of users
    • without the grouping, change the sort direction on the desired grouping field – you may find ’empty’ values

    Also just a headsup – you didn’t mention what you are using to create the extra fields. For extra fields that are actually embedded in another field in the DB, it is not going to be easy to sort or group by them in new non-cache version. S2 member custom fields are an example. The only way around it that I can think of is to ‘extract’ those fields into a normal usermeta so they can be sql queried directly, and I may either offer an add-on for that or a conversion tool or suggest that people IF they want to sort, group or filter by those fields that they use a different custom fields plugin for those fields. Straight display and format will be fine.

    • This reply was modified 7 months ago by  anmari.
    Plugin Author anmari

    (@anmari)

    Also check whether you have overwritten the sort order. Grouping MUST sort by the same field obviously. The grouping update will try make this happen, but with delays in cache updates it can get confusing

    Plugin Author anmari

    (@anmari)

    I can’t replicate the problem you describe. See https://directories.wpusersplugin.com/weirdwonderful/list-with-a-grouping/ – the dash at the top – the dash is there because that user does not have a value for the current grouping field (moods at moment) – was first role earlier, may change at any time 😉

    Basically

    • make sure you understand all your data (any empty records etc) – since the sorting changes, the order the records appear in changes – make sure you are looking at the same user record each time to understand what’s happening.
    • Make sure settings are consistent (sorting, headings, groupings)
    • Then rebuild cache.
      If you have any other cacheing going on, that may impact. Try even a clean browser.
    linds

    (@lsterling03)

    Hi Anmari, thank you for your response. I create a dev site using the default WP theme, and only the AMR and AMR Plus Groupings plugins activated. I created 4 users and confirmed each user has a value for the grouping field. The same problem exists there as well. I will send you an email with a link, if you’d like to check it out.

    The field I’m using for grouping comes from “Events Manager Pro” plugin. The value is populated via a select box in the user profile. The value is plain text.

    Administrators, Editors and Authors do not use this field, but all Subscribers (we renamed this role Teachers) do have a value for this field, and our User Lists only contain users in this role.

    I’ll send you an email to continue the conversation. Thank you again for responding!

    Plugin Author anmari

    (@anmari)

    resolved by email

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Adding a grouping breaks a list’ is closed to new replies.