Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Notice: Undefined index: party_attaching_party in views_natural_sort_get_supported_entity_properties() (line 333 of /sites/all/modules/views_natural_sort/views_natural_sort.module).
Solved by change line 333 of views_natural_sort.module to:
if (isset($property_info['schema field']['type']) && $schema['fields'][$property_info['schema field']]['type'] != 'varchar') {
Comment | File | Size | Author |
---|---|---|---|
#9 | Screenshot_2016-02-16-08-39-45.png | 592.96 KB | generalredneck |
#4 | views_natural_sort-Incompatibility_with_Party_module-2667926-4.patch | 627 bytes | generalredneck |
| |||
#3 | views_natural_sort_patch.txt | 1.68 KB | lionguard |
Comments
Comment #2
lionguard CreditAttribution: lionguard as a volunteer commentedComment #3
lionguard CreditAttribution: lionguard as a volunteer commentedI created a patch file which solves this notice as well as some other notice/warnings due to unset variables
These might be PHP 5.6+ only issues btw
Comment #4
generalredneck@lionguard
Thanks for the patch. For future reference, there is an approved workflow for patches using git. If you don't have git, (or did like you did and happened to have 2 copies of the same module), consider still using the patch name format of
[project_name]-[short-description]-[issue-number]-[comment-number].patch
.For those who work on sites professionally, this does a lot for documenting where to find updated information on patches in our drush make files, composer.json, PATCHES folder, or PATCHES.TXT, as that format gives us specifically the issue number and comment number.
Thank you for keeping the patch in a -p1 format as well. That helped out a lot.
Lastly, When you submit a patch, move the issue to "needs review" if possible.
With all that said, the real problem here was there is an array_merge above. it was clobbering the existing property values with what was supposed to be the property defaults. So in this case... every $property_info['type'] was "text". Since it was overloading party module's property info type (which was "party") with text, we were making it down to the next line where we were trying to get info from the "User" table for the schema field "party_attaching_party". Clearly it does not have that field because the "Party" type property is handled differently.
You will want to undo your patch on your local code as views natural sort will most likely not be working for you at all.
Test out the patch I worked up and let me know if it gets rid of your notices.
Comment #7
generalredneckwent ahead and committed this one. give me a heads up if you see anything else. specific to the error "Notice: Undefined index: party_attaching_party in views_natural_sort_get_supported_entity_properties()"
Comment #8
duckydan CreditAttribution: duckydan commentedNever mind.
Comment #9
generalredneckYou should also get the fix in 2.2. Shouldn't need the development release.
Comment #10
duckydan CreditAttribution: duckydan commentedUnderstood. I thought the error I had went away but it did not. My mistake.
I am getting this:
But I have not looked deeply into. I was going to add in an isset in there somewhere before line 333 to see if I could take care of it. Not sure where vuuid is even coming from.
Comment #11
duckydan CreditAttribution: duckydan commentedAlso seeing this:
Again, not sure where from.
Comment #12
generalredneckCan you please create separate issues for your new notices? you are starting to use this issue as a catch all for notices and the point was to look into the party module.
We can follow up on additional questions in the repective issues for #10 & #11 since it's clearly a different module causing the behavior. Specifically for #10... one that produces a entity with vuuid.
Appreciate it tons.
Comment #13
duckydan CreditAttribution: duckydan commentedWill do.