Closed (fixed)
Project:
Redirect Widget
Version:
1.0.0-beta1
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2026 at 20:45 UTC
Updated:
3 Mar 2026 at 22:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
velmir_taky commentedRoot cause
RedirectWidgetManager::submitRedirectWidgetForm()andgetRedirectWidget()callisPublished(),setPublished(), andsetUnpublished()onRedirectentities. These methods are provided byEntityPublishedTrait, which was only added toRedirectin redirect 1.12.0. Earlier versions (including 1.11.0 and below) do not implementEntityPublishedInterface, so these calls trigger a fatal error.The redirect_widget
composer.jsonrequiresdrupal/redirect: ^1.0, which allows installing with any 1.x version including those without published state support.Fix
All five call sites are now guarded with
$entity instanceof EntityPublishedInterfacechecks:-
getRedirectWidget()line 92: disclaimer for unpublished redirects-
submitRedirectWidgetForm()line 197: prevent removal of published redirects in unpublished state-
submitRedirectWidgetForm()lines 220-232: publish/unpublish logicWhen the redirect entity does not support the published state (redirect < 1.12.0), the publish/unpublish logic is simply skipped and the redirect is saved as-is. The status message for new redirects is now shown regardless of published state support.
Comment #4
mauro_ commentedThanks for bringing this issue to light. However, I don't think it's a good solution to make this backwards compatible with older versions of the Redirect module, as this module was created and released after their release of 1.12. Whilst your fix seems fine, I fear that in the long run this will introduce unnecessary complexity in the code.
Therefore I will just specify the version of Redirect required for this module and link to this issue for those who want to patch to older versions.
I appreciate the effort!
Comment #7
mauro_ commentedComment #9
mauro_ commentedComment #10
mauro_ commented