Always keep homepage, 403 and 404

Created on 11 October 2024, 2 months ago

Problem/Motivation

This module aims to solve sort of the same problems as prevent_homepage_deletion, since their last update to also protect 403 and 404 page.

Proposed resolution

Make one of the modules obsolete. Probably by always keeping nodes that are configured in system.site.yml. This way you always keep the most important pages, so the site will not break, without the need to configure these pages manually. We might add a setting to always protect them or leave it to individual settings.

Feature request
Status

Active

Version

2.2

Component

Code

Created by

🇳🇱Netherlands jeroen dost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jeroen dost
  • 🇮🇳India divyansh.gupta Jaipur

    Added the feature where it always keeps homepage, 403 and 404 and prevents them from being deleted as the site may crash if these important nodes are deleted.

  • Pipeline finished with Success
    2 months ago
    Total: 201s
    #309893
  • 🇩🇪Germany Anybody Porta Westfalica

    This is really a nice idea! But implementation looks a bit hacky to me and I think this should be optional, so it would need a settings page to enable this functionality.

    But just my 2 cents ;)

  • 🇳🇱Netherlands joshahubbers

    I agree that a setting should be preferrable to prevent unexpected functionality.

    What I was wondering: the normal work of this module is a checkbox at the node page (I did not live test the module, but that's what I got from the documentation, correct me if I'm wrong). If this is the point, the checkbox should be checked and grayed out on the page that is set as homepage, 404 and 403 by default to keep consistency with the normal working way of this module.

    A last point: is unpublishing of the page also prevented for these modules?

    When these points are fixed, I think we can deprecate the prevent_homepage_deletion module in favour of this one.

  • 🇮🇳India divyansh.gupta Jaipur

    Hello @joshahubbers, @anybody
    I proposed my solution as per the problem mentioned in the summary that if a page mentioned in system.site.yml is deleted than it may cause the site to break.
    So as per your suggestions i will work and create a option to enable/disable this feature in settings form.
    Also @joshahubbers i have not created any checks while unpublishing the pages mentioned in system.site.yml.

  • 🇳🇱Netherlands joshahubbers

    Thank you! That's nice.

    Maybe the check for unpublished should be a seperate ticket because it is new global functionality, don't you think? If so than I can create a new issue for that?

  • 🇮🇳India divyansh.gupta Jaipur

    Hello @joshahubbers,
    I have applied the changes according to requirements and it would be a great idea to create a seperate issue for it.
    Also if you think my work is correct and requires no changes according to this issue, can you please move my ticket to needs review.

  • 🇳🇱Netherlands joshahubbers

    Hi @divyansh.gupta,

    you said in #7:

    So as per your suggestions i will work and create a option to enable/disable this feature in settings form.

    I am missing that in this branch?

  • 🇮🇳India divyansh.gupta Jaipur

    Sorry forgot about that will make the changes.

  • 🇮🇳India divyansh.gupta Jaipur

    Created a option to enable and disable this functionality in settings form also tested it and it is working fine from my side.

  • Pipeline finished with Success
    about 1 month ago
    Total: 139s
    #344615
  • 🇳🇱Netherlands joshahubbers

    Sorry, I know I am a knit-wit... but "enabled" suggests the variable enables the entire functionality. But it enables/disables the protection of 404, 403 and front pages. Maybe rename that to "protect_404_403_front"? Than it is obvious what the setting does...

  • Pipeline finished with Success
    27 days ago
    Total: 147s
    #349199
  • 🇮🇳India divyansh.gupta Jaipur

    @joshahubbers,
    I have made the changes please check.

  • 🇳🇱Netherlands joshahubbers

    Yes, great. Now only test-coverage is missing. ;-)

Production build 0.71.5 2024