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.
When i run cron jobs, i get following error:
What would be the reason for this error. I couldn't find in post issues.
Thank you very much.
Notice: Trying to get property of non-object in xmlsitemap_generate_chunk() (line 169 of /home/tarifeye/public_html/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc).
Comment | File | Size | Author |
---|---|---|---|
#26 | xmlsitemap-xmlsitemap-generate-chunk-error-1396220-26.patch | 1014 bytes | marco-s |
| |||
#19 | xmlsitemap-xmlsitemap-generate-chunk-error-1396220-19.patch | 819 bytes | devad |
| |||
#9 | xmlsitemap-1396220-9.diff | 726 bytes | chromix |
#4 | xmlsitemap-1396220-4.patch | 712 bytes | Anonymous (not verified) |
Comments
Comment #1
trante CreditAttribution: trante commentedAny comments?
Comment #2
trante CreditAttribution: trante commentedDoes anyone know how can i debug or remove this error on xmlsitemap_generate_chunk method usage?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedLine 169 of xmlsitemap.generate.inc is
So this is telling me that $link['language'] isn't a valid object but should be. Some module other than xmlsitemap is causing this or perhaps you've something defined incorrectly with regard to 'locale'. The easiest method I've found to debug these is to temporarily modify the above to:
This will give you a back trace to which should give you a clue.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedThe real problem with this is that $link['language'] can never be an object. Its value is the varchar value from the database. The attached patch resolves this issue.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedThe patch isn't quite right. The error only happens if the language is set to LANGUAGE_NONE. Further development to resolve this issue is occurring.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm thinking that this issue is resolved by #1593508: The value of 'language' when the value is LANGUAGE_NONE. Please test it a let me know if it resolves the issue.
Comment #8
2phaThe patch linked to above fixed the issue for me
Comment #9
chromix CreditAttribution: chromix commentedHere's an updated patch. Seems to have quieted down the logs, which is good. Hopefully this one passes.
Comment #10
gratefulsk CreditAttribution: gratefulsk commentedThanks Chromix. Your patch fixed these errors for me.
Comment #11
Grayside CreditAttribution: Grayside commentedComment #12
agerson CreditAttribution: agerson commentedThis works for me as well.
Comment #13
andrei.dincu CreditAttribution: andrei.dincu commentedWorks fine for me also.
Good job chromix.
Comment #14
andrei.dincu CreditAttribution: andrei.dincu commentedComment #15
jasom CreditAttribution: jasom commentedError disappeared thanks to patch in #9.
Comment #16
marcoka CreditAttribution: marcoka commentedalso have that notice galore in my logs. #9 seems to fix. will report back if i discover problems.
Comment #17
scareyclott CreditAttribution: scareyclott commentedHi,
I am using Version 7.x-2.3 and getting the same error but about line 188
Notice: Trying to get property of non-object in xmlsitemap_generate_chunk() (line 188
I guess it is the same issue as a look at the line shows it talks about Language. I am not a coder is it possible for someone to re jig the Patch for Version 7.x-2.3
Regards Scott
Comment #18
aralnoth CreditAttribution: aralnoth commentedI have the same issue in 8.x version. I tested the patch in #9, making the necessary changes to adapt it to the drupal 8 code, and works properly.
Comment #19
devad CreditAttribution: devad as a volunteer commented#9 patch re-roll for latest .dev
Some reviews would be nice and if it is becomes RTBC again... commit would be nice as well before new re-roll is needed.
Comment #20
pifagorlook good
Comment #21
devad CreditAttribution: devad as a volunteer commentedComment #22
alex_optim+1
Comment #23
pifagorComment #25
pifagorComment #26
marco-sUnfortunately, this modification generates another issue. With this change, the language value in the URL is missing because the url() function expects an object for the language (see: includes/common.inc:2311). We have to convert the value to an object, not the object to string.
This patch is based on the current dev version (dev-2.x e47457f).
Comment #27
SurfinSpirit CreditAttribution: SurfinSpirit at FFW commentedFaced the same issue marco-s noticed. Given this issue already has committed code opened a new issue as a follow up. https://www.drupal.org/project/xmlsitemap/issues/2987673
marco-s there is no need to convert value to object, language object is already there before the code from this issue patch is executed so the line that rewrites the object by language code should be removed and the code below needs to be adjusted.
Comment #28
pifagorFixed here - https://www.drupal.org/project/xmlsitemap/issues/2987673
Comment #30
vbard CreditAttribution: vbard commentedJust saw this in Drupal dblog with latest dev:
Notice: Trying to get property of non-object в функции xmlsitemap_generate_chunk() (строка 213 в файле /home/admin/web/mydomain/public_html/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc).