Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalGov Alert banners giving content moderation error when setting live #181

Closed
rowan-austin-investis opened this issue Nov 8, 2021 · 5 comments

Comments

@rowan-austin-investis
Copy link

Hello all,

I've been experiencing this issue on my site when trying to publish an alert banner.

InvalidArgumentException: Field moderation_state is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /var/www/docroot/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

This is happening on all alert banners on my site, I also have Workflows (Content Moderation) installed on my site.

All of my LocalGov modules are up to date aswell as Drupal. I've also uninstalled any custom modules when testing incase they were interfering.

Steps to reproduce:

  1. Install LocalGov with it dependencies including alert banners.
  2. Create an alert banner
  3. Try to put the banner live
  4. At this point you should get the error stated above.

If anyone has info or issues they've had similar it would be greatly appreciated!
Thank you

@andybroomfield andybroomfield transferred this issue from localgovdrupal/localgov Nov 8, 2021
@andybroomfield
Copy link
Contributor

andybroomfield commented Nov 8, 2021

Thanks for the report @rowan-austin-investis.
I was able to do a fresh install and add an alert banner with the steps you included without issue.

Was your issue a fresh install or an upgrade?
v1.2 released in September added content moderation support for use with scheduled transitions.

Do you have scheduled transitions and localgov_workflow turned on?
(It should be possible to use without, but may help eliminate some possible causes).

There is a known issue with including the moderation form it overrides the confirmations form, however the moderation field should still be included.

If you go to /admin/structure/alert-banner-types/localgov_alert_banner_type/localgov_alert_banner/edit/form-display is there a content moderation field and under /admin/config/workflow/workflows is there a corresponding workflow?

@andybroomfield
Copy link
Contributor

andybroomfield commented Nov 8, 2021

I was able to reproduce the error by deleting the alert banner workflow and I now get the same error message.
@rowan-austin-investis I think you have either deleted that workflow, or you had an older version that didn't get the workflow added when you upgraded.

You can install the workflow config that is in the module workflows.workflow.localgov_alert_banners.yml and that should fix your issue.

Then we need to check that the update hook is adding the correct workflow.

@willguv
Copy link
Member

willguv commented Nov 8, 2021

Cheers for looking at this @andybroomfield. Much appreciated

@rowan-austin-investis
Copy link
Author

Thank you so much for looking at this @andybroomfield, I'll install the config and give it a test then report back!

@rowan-austin-investis
Copy link
Author

@andybroomfield After importing the config and doing a little playing my banners are now publishing again! Thank you for your help on this one, I can confirm that nothing is broken in the module itself and it was config that was the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants