When I am trying to rebuild sitemap I get the following error:

ResponseText: The website encountered an unexpected error. Please try again later. RuntimeException: Host entity for field collection item (39) was not set. in Drupal\field_collection\FieldCollectionItemAccessControlHandler->checkAccess() (line 26 of modules/contrib/field_collection/src/FieldCollectionItemAccessControlHandler.php). Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, ) (Line: 631)

During the investigation, I created a view called "Field Collections (Field Collection Item) " (attaching) and then I tried to see a page with field collection ID 39 I got the error:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">RuntimeException</em>: Host entity for field collection item (39) was not set.

I tried open as /field_collection_item/39 and get the following error:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function access() on null in Drupal\field_collection\Access\FieldCollectionItemHostOperationCheck->access() (line 30 of modules/contrib/field_collection/src/Access/FieldCollectionItemHostOperationCheck.php).

I checked the node what using this Field Collection ID 39 and found this Field Collection Item was deleted.

So steps to reproduce:
Create a node with Field Collection or few.
Edit this node and delete one item.
Run rebuilding of sitemap or just try to open using following path /field_collection_item/39.

Thank you.

The screen of my view:
fc

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ruslan P created an issue. See original summary.

Ruslan Piskarov’s picture

Issue summary: View changes
Ruslan Piskarov’s picture

Issue summary: View changes
Ruslan Piskarov’s picture

Issue summary: View changes
Ruslan Piskarov’s picture

Issue summary: View changes
lucmulder29’s picture

Hi RuslanP,

I am fasing a similar issue. I was wondering if you have been able to resolve your problem, and if so, how you did that.

Thanks in advance,
Luc

Ruslan Piskarov’s picture

Hi lucmulder29,
For sites with Field collection instead of xmlsitemap module, for now, I am using simple_sitemap.
And for all new projects, I use Paragraph instead of Field collection and xmlsitemap.

ram4nd’s picture

Status: Active » Closed (won't fix)
Issue tags: -xmlsitemap, -views