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

Modular pages share shortcodes #87

Open
mbiegert opened this issue Mar 13, 2020 · 1 comment
Open

Modular pages share shortcodes #87

mbiegert opened this issue Mar 13, 2020 · 1 comment

Comments

@mbiegert
Copy link

Hi, I'm having trouble with modular pages, I have a bunch of modular pages with some [sections]. Each modular (sub)page contains a section with the same name.

The problem is that the shortcodes are added to the ShortcodeManager instance per request and are not cleared. That means that my three modular pages that each have a section [section name=first] all share the "first" section of the modular page that gets parsed first.

I suggest clearing the objects array before/after the processing of a (modular) page. For me adding $this->shortcodes->resetObjects() at the beginning of the processShortCodes function in shortcode-core.php works. But this breaks pages that also require rawHandlers (I don't).

k8n added a commit to k8n/grav-plugin-shortcode-core that referenced this issue Feb 8, 2021
A workaround suggested in getgrav#87. Likely addresses getgrav#96 and getgrav#97 as well.
k8n added a commit to k8n/grav-plugin-shortcode-core that referenced this issue Feb 8, 2021
A workaround suggested in getgrav#87. Likely addresses getgrav#96 and getgrav#97 as well.
@k8n
Copy link
Contributor

k8n commented Feb 8, 2021

It appears that #96 and #97 are the same bug. The issue is easy to catch when precache is in use. All pages rendered in the same thread carry processed sections from the first page rendered.

rhukster pushed a commit that referenced this issue Mar 10, 2021
A workaround suggested in #87. Likely addresses #96 and #97 as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants