Receiving this error when trying to rebuild (even first) xmlsitemap. Nodes contain 1 field that is a field collection.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=44&op=do_nojs&op=do
StatusText: OK
ResponseText: Error: Call to a member function access() on null in Drupal\field_collection\FieldCollectionItemAccessControlHandler->checkAccess() (line 38 of /var/www/docroot/modules/field_collection/src/FieldCollectionItemAccessControlHandler.php).

Comments

enapthine created an issue. See original summary.

jenstechs’s picture

I have this same error, and all of my content types have field collections, so this is preventing me from generating any xml sitemaps.

And when I went to rebuild, I specifically did NOT select 'field collection' in the select list. I ONLY selected 'node'.

I suspect this may have to get kicked over to the Field Collection module, but still, xmlsitemap should not be calling it on field collection if I didn't select it.

enapthine’s picture

@jenstechs: I assume its due to the nodes containing field_collections. I have the same scenario as you.

jenstechs’s picture

I went to simple_sitemap for now. It works out of the box.

jenstechs’s picture

I'm having multilingual issues with simple_sitemap and would like to see if xmlsitemap works...but I see this hasn't even been acknowledged as an issue yet...

sureshcj’s picture

I also had the same problem. Is there any other solution for this ?
kindly update the queue it could be more useful for all.

dkynast’s picture

Same here!
Any updates regarding ETA on this? Field_collection (which is pretty popular) and xmlsitemap are incompatible.

jonnyeom’s picture

There is a patch for the field collections module here ->
https://www.drupal.org/node/2738517

In my case, this patch got me to the next step but now I'm running into a different error that says

RuntimeException: Host entity for field collection item (1) was not set. in Drupal\field_collection\FieldCollectionItemAccessControlHandler->checkAccess() (line 31 of /var/www/project/web/modules/contrib/field_collection/src/FieldCollectionItemAccessControlHandler.php).

jonnyeom’s picture

Status: Active » Needs review
jonnyeom’s picture

Actually, once I switched over to the Dev version of the module, the patch did the trick.
My sitemap is working. I hope the field collections patch works for you guys.

dkynast’s picture

I am running the most recent dev versions of xmlsitemap and field_collection, added the mentioned patch. The patch fixes this actual ticket for me.

Now I get the RuntimeException: Host entity for field collection item error, which seems to be a bug that has its reason in broken field_collections created with former 8.x versions of field_collection (as far as i can tell).

soorepalli’s picture

While creating the sitemap links, I am getting the same error.

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=22&op=do_nojs&op=do
StatusText: OK
ResponseText:
Fatal error: Call to a member function access() on null in xxxxx\modules\field_collection\src\FieldCollectionItemAccessControlHandler.php on line 38

Orabi’s picture

This issue on field collection seems to "partly" useful
https://www.drupal.org/node/2738517