Download & Extend

xmlsitemap_generate_chunk error

Project:XML sitemap
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:earnie
Status:active
Issue tags:Release blocker

Issue Summary

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).

Comments

#1

Any comments?

#2

Does anyone know how can i debug or remove this error on xmlsitemap_generate_chunk method usage?

#3

Line 169 of xmlsitemap.generate.inc is

<?php
      $link
['loc'] = xmlsitemap_get_path_alias($link['loc'], $link['language']->language);
?>

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:

<?php
      
if (!is_object($link['language'])) {
         throw new
Exception('$link[language] is not an object');
      }
     
$link['loc'] = xmlsitemap_get_path_alias($link['loc'], $link['language']->language);
?>

This will give you a back trace to which should give you a clue.

#4

Category:support request» bug report
Priority:normal» critical
Status:active» needs review

The 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.

AttachmentSizeStatusTest resultOperations
xmlsitemap-1396220-4.patch712 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 522 pass(es), 20 fail(s), and 59 exception(s).View details | Re-test

#5

Status:needs review» needs work

The last submitted patch, xmlsitemap-1396220-4.patch, failed testing.

#6

The 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.

#7

Component:xmlsitemap.module» Code
Priority:critical» major
Assigned to:Anonymous» earnie
Status:needs work» active

I'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.

nobody click here