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.
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
Comment #2
jennypanighetti CreditAttribution: jennypanighetti commentedI 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.
Comment #3
enap CreditAttribution: enap commented@jenstechs: I assume its due to the nodes containing field_collections. I have the same scenario as you.
Comment #4
jennypanighetti CreditAttribution: jennypanighetti commentedI went to simple_sitemap for now. It works out of the box.
Comment #5
jennypanighetti CreditAttribution: jennypanighetti commentedI'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...
Comment #6
sureshcj CreditAttribution: sureshcj commentedI also had the same problem. Is there any other solution for this ?
kindly update the queue it could be more useful for all.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedSame here!
Any updates regarding ETA on this? Field_collection (which is pretty popular) and xmlsitemap are incompatible.
Comment #8
jonnyeom CreditAttribution: jonnyeom as a volunteer commentedThere 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).
Comment #9
jonnyeom CreditAttribution: jonnyeom as a volunteer commentedComment #10
jonnyeom CreditAttribution: jonnyeom as a volunteer commentedActually, 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.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedI 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).Comment #12
learnbydrop CreditAttribution: learnbydrop commentedWhile 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
Comment #13
Orabi CreditAttribution: Orabi commentedThis issue on field collection seems to "partly" useful
https://www.drupal.org/node/2738517
Comment #14
Dave ReidI 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.