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

[seo-magic] Current Pages inaccessible via admin after install #457

Open
blizam opened this issue Jul 16, 2024 · 3 comments
Open

[seo-magic] Current Pages inaccessible via admin after install #457

blizam opened this issue Jul 16, 2024 · 3 comments
Assignees
Labels
seo-magic SEO Magic plugin

Comments

@blizam
Copy link

blizam commented Jul 16, 2024

After installing SEO Magic and generating SEO data on a new environment I was provided with (that I'm unsure of the setup for... I did switch between PHP 7.4 and 8.3; no difference and verified all PHP modules are installed) I ran into the following error when trying to access any exiting Page via the admin OR creating any new Page (and then regenerating SEO data):

Error:
preg_replace(): Unknown modifier '~'

image
image

When creating a new page:
with admin functions disabled after initially saving the page the SEO magic tab would always have the red banner that says "SEO Magic Data has not been generated for this page, click Save to generate." but the page would remain accessible... you could save+close, go to another page, come back... still no SEO data/red banner, but page is accessible. After then regenerating data forcefuylly/manually from the plugin settings button (or by having admin function enabled on initial save) the page becomes inaccessible with the same error.

I was able to get around this error by:

  1. Changing the Page Title of every page via the page's yaml file (FTP/SSH) (maybe touching the file would've been enough?)
  2. Regenerating SEO data from the plugin's admin

create new page > forcefully rengerate seo data (admin page breaks) >edit the page's title via the yaml file > regenerate seo data again (admin page is accessible)

something with existing pages and new pages not have/getting SEO data generated that fails when it's force to generate for the first time but succeeds when the page is modified (via yaml since admin is inaccessible) and data is forcefully generated a 2nd time

I tried disabling the Grav cache entirely to no effect, so seems like it's something specific with SEO Magic's data for existing and brand new pages.... but once the page is edited manually via the yaml file and SEO data is generated again, the page is accessible.

I have not run into this issue on other environments... which are likely running an older SEO Magic... I'll go test those, and upgrade + test when I have some time.

@blizam blizam added the seo-magic SEO Magic plugin label Jul 16, 2024
@rhukster
Copy link
Member

This is strange, never seen this error here before. Can you send me a copy of the page's .md file so I can see if I can recreate it?

@blizam
Copy link
Author

blizam commented Jul 20, 2024

It's pretty basic:

---
title: 'New Test Page'
sitemap:
    lastmod: '20-07-2024 17:52'
---

  1. With admin actions off create a new page, page saves successfully (with above YAML), and SEO Magic tab has red banner saying SEO data was not generated
  2. Click the icon to regenerate all SEO data
  3. Try to access page in the admin again and get the error

You can skip steps 2 and 3 with admin actions on, it'll go straight to the error on save and it will still actually create the page

Then, if I just change the YAML (title) ever so slighty:

---
title: 'New Test Page 2'
sitemap:
    lastmod: '20-07-2024 17:52'
---

And regenerate SEO data with the icon (if I don't do this, it still errors), everything is fine.

PHP Version 8.3.8 (tested on 7.4 as well)
Server API | LiteSpeed V8.1 Cloudlinux 1.3
Virtual Directory Support | disabled

@blizam
Copy link
Author

blizam commented Jul 25, 2024

It's something with the Flex Objects plugin... or probably more aptly it's to-do with the extra stuff the Flex Objects plugin enables in the Admin... like the Pages Search and more advanced Pages admin... notably when I Save a new Page SEO magic thinks it's not published (even though it shows Published)... I dunno... Maybe SEO Magic doesn't work at all without Flex Objects? If I disable the Flex Objects plugin I don't encounter the error any more... but maybe that's just a red herring if it effectively disables SEO Magic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
seo-magic SEO Magic plugin
Projects
None yet
Development

No branches or pull requests

2 participants