kirby-deprecated-plugins / kirby-seo

51 stars 10 forks source link

Error When Clicking URL and 'Change URL' Is Forbidden #42

Open luxlogica opened 7 years ago

luxlogica commented 7 years ago

For most top-level pages ('home', 'blog', 'shop', etc.), I disallow the option to 'Change URL'. In a page that doesn't allow the user to change the URL, clicking on the URL link inside the SEO field will cause an error. If the site's 'debug' option is true, it will trigger the Kirby debugger. If 'debug' is false, it will go to a Panel Error page that states that 'you are now allowed to do this'.

Steps to reproduce:

  1. edit the blueprint of one of your site's pages, to disallow changing of the page's URL:

    title: Home
    icon: home
    options: 
    url: false
    [...]
  2. add the SEO field to the page:

    fields:
    seo:
    type: seo
  3. Go to the Panel, and in the SEO field that is now displaying, click the page's URL - which appears in green underneath the Page Title.

This will cause an error on the site - Kirby 2.5.4.

Ideal Solution: The plugin should check whether 'change url' is permitted for the current page/user, and if not, the URL in the field should not be a clickable link.

luxlogica commented 7 years ago

The fix for this has now been submitted as pull request #44. 👍