Closed kees-closed closed 2 years ago
Thanks I’ll take a look.
Ok, its. simply because you have quotes around your start
and depth
which make them a string, when they should be an int.
should be:
enabled: true
active: false
start: 2
depth: 6
I've added a fix that will force conversion of string to int in this case, but you can easily fix it with the config above.
BTW, Page-TOC plugin can now effectively replace the anchors plugin. You don't need both. Page-TOC is actually better at it because its done in the content directly and cached, and is not done by the browser via JS.
Thanks for the quick fix! I use the admin panel to configure the plugins. I guess the slider in the admin panel for this plugin outputs strings instead of int's.
I'll keep an eye out for the update. Thanks again!
@rhukster is there by the way a sort of newsletter about new interesting plugins or when certain plugins replace others?
There isn't but it's a good idea!
The issue persists, even when I remove those quotes from the start and depth values. Cleared the cache and removed the Anchor plugin (just in case). Still crashes with the same error.
You are running Grav v1.7.25
Yaml Linter
===========
User Configuration
------------------
[OK] No YAML Linting issues with configuration
Pages Frontmatter
-----------------
[OK] No YAML Linting issues with pages
Page Blueprints
---------------
[OK] No YAML Linting issues with blueprints
It won't show up as a YAML linting error as both string and integer values are valid in YAML, and the linting is just checking valid YAML and has no way to determine the expected type even if it was set.
I think you probably still have strings in the config file that it's using (maybe from an environment-based config). You can see this in the "config" tab of the debugbar.
Tomorrow i'll paste the 2 line code fix, don't have it handy right now.
I purged all configs and reinstalled it. That fixed it indeed. But after setting Start TOC headers
and Start Anchor headers
in the admin panel, ints are added to config/plugins/page-toc.yaml
. Converting the type when loading the values works, but it might also be a good idea to fix this in the admin panel. It might prevent other plugins for crashing in the future.
I also purged and reinstalled and the error persists.
Just released v3.1.1 that should fix this.. You might need to save your options again in the admin to ensure they are saved as integers instead of strings.
When upgrading from 3.0.0 to 3.1.0 I (only now) noticed double anchors on my website. This is because I also use the official plugin Anchors. Since I don't see the point in having this twice, but I do want to keep anchors elsewhere, I decided to disable them in the TOC plugin.
After saving those settings my site crashes with the error below:
When restoring the anchor settings in the TOC plugin and refreshing the same error persisted. I now have the TOC disabled to keep my website functional.
In my
user/config/plugins/page-toc.yaml
is the following:Other than that, no custom changes enabled.