failed to load include fields on production mode by blocks
Hi,
I load blocks with with getResourceObjectFromContext in the getStaticProps
const [footerContact] = await drupal.getResourceCollectionFromContext<any>( 'block_content--footer', context, { params: getParams({ name: 'block_content--footer' }) .addInclude(['field_form']) .addFilter('info', 'footer-contact') .getQueryObject(), } );
This is a normal block element and I filter this by his info. The getParams function is a copy of the Umami example from you.
if (name === 'block_content--footer') { return params.addFields(name, [ 'field_headline', 'field_form', 'body', 'field_icon', 'field_link', ]); }
My problem is:
In the local environment is no problem to load the form. But if I develop this in production mode, the include field will not return any relationships anymore, so I became a empty form only with the relationship information but no content.
Hmm. Is there any difference, say permissions, on your prod site vs the dev one? If the relationship field_form exists and the Next.js site has access to it, it should behave the same way on both prod and dev.