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.

jennypanighetti’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.

enap’s picture

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

jennypanighetti’s picture

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

jennypanighetti’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.

Anonymous’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.

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

learnbydrop’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

Dave Reid’s picture

I think the solution is that you should probably disable indexing of field collection entities entirely. Which you can do from the current version of the module. I will look into this with #3079398: Provide support for entity types without base tables to ensure that Field Collections should not show up as a supported entity type.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.