Page content not saving

I am using Grav 1.6.19 with Admin 1.9.12 on a Windows 10 PC with Google Chrome 79.0.3945.88.

I’ve been actively editing pages via the Admin interface and had no issue up until this point, but for some reason, there is one page that will not save any changes that I make. I click Save, the page refreshes (like it’s going to save), and then it shows the content before the save.

I’ve tried clearing the cache through the Admin interface and clearing my browser cache. I also looked at the web server permissions to see if there was anything different on this one page. The permissions are identical to the other pages on the site, which I have no trouble editing/saving. I also checked to see if I was getting any errors in Google Developer Tools in the console (to see if maybe some sort of Javascript error was being thrown), but I see nothing.

1 Like

Has your server mod.security enabled ?
Maybe some HTTP headers are filtered and prevent contents to be written,

You would see this in the server logs:

– Harald

1 Like

If it’s a page with a specific blueprint, there might be an error in its blueprint.

So it appears that mod.security is enabled. I downloaded the logs, but haven’t been able to make any sense of them. Is there anything I’m looking for specifically?

1 Like

I think thats an error from a blueprint. Is there anywhere a type error or something else in the blueprint YAML file?

I looked at the blueprint for the theme, but I’m not seeing any issues that are sticking out. I also ran it through a YAML Validator (YAML Lint) to see if it caught any errors, but it came up empty, too.

So you’re saying it’s not an issue with mod.security?

In most cases mod.security is configured to write its output to the Apache log file. Examine the log exactly at the time you try to save. If mod.security blocks you, you will see the ID of the security rule, which is applied. E.g.:

If you have the ID, you can exclude this rule in the mod.security config or ask your provider to do so.

If you have admin access, just disable mod.security, to determine if it blocks you or not.

If you can share your blueprint, we can test it and see if it works or not.

Ok, I just went back and try to edit the page again and it seems to be working fine. I had tried multiple times over the course of three days before submitting this topic, so it wasn’t just a one-time glitch. But maybe the issue was on my server’s end, and has been resolved. Strange.

Thank you for the help!

Just for kicks, do you see any issues with the code below?

name: HPHC
version: 1.0
description: New Grav Default Theme
icon:  microchip
author:
  name: Alex MacDonald
  email: alexsmacd@gmail.com
  url: http://alexm.ac
  
dependencies:
  - { name: grav, version: '>=1.6.0' }

form:
  validation: loose

  fields:
    production-mode:
      type: toggle
      label: Production mode
      help: When enabled, Quark will render with minified CSS
      highlight: 1
      default: 1
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    grid-size:
      type: select
      label: Grid size
      help: The maximum width of the theme
      size: small
      options:
        '': None (full width)
        grid-xl: Extra Large
        grid-lg: Large
        grid-md: Medium

    header_section:
      type: section
      title: Header Defaults
      underline: true

    custom_logo:
      type: file
      label: Custom Logo
      size: large
      destination: 'theme://images/logo'
      multiple: false
      markdown: true
      description: Will be used instead of default logo `theme://images/grav-logo.svg`
      accept:
        - image/*

    custom_logo_mobile:
      type: file
      label: Mobile Custom Logo
      size: large
      destination: 'theme://images/logo'
      multiple: false
      accept:
        - image/*

    header-fixed:
      type: toggle
      label: Fixed header
      help: When enabled, the header will be fixed at the top of the browser
      highlight: 1
      default: 1
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    header-animated:
      type: toggle
      label: Animated
      help: When enabled, the header will animate to a smaller header when scrolling
      highlight: 1
      default: 1
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    header-dark:
      type: toggle
      label: Dark Style
      help: When enabled, a dark-friendly style will be used
      highlight: 0
      default: 0
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    header-transparent:
      type: toggle
      label: Transparent
      help: When enabled, a transparent style will be used
      highlight: 0
      default: 0
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    footer_section:
      type: section
      title: Footer Defaults
      underline: true

    sticky-footer:
      type: toggle
      label: Sticky footer
      help: When enabled, the footer will be sticky at the bottom of the browser
      highlight: 1
      default: 1
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    blog_section:
      type: section
      title: Blog Defaults
      underline: true

    blog-page:
      type: text
      label: Blog Page
      help: The route to the blog page when working with blog sidebar
      size: medium
      default: '/blog'

    spectre_section:
      type: section
      title: Spectre.css Options
      underline: true

    spectre.exp:
      type: toggle
      label: Experimentals CSS
      help: When enabled, the `spectre-exp.css` file will be included
      highlight: 0
      default: 0
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool

    spectre.icons:
      type: toggle
      label: Icons CSS
      help: When enabled, the `spectre-icons.css` file will be included
      highlight: 0
      default: 0
      options:
        1: PLUGIN_ADMIN.ENABLED
        0: PLUGIN_ADMIN.DISABLED
      validate:
        type: bool