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

How can I migrate helpers/Modifiers.php #69

Closed
joevallender opened this issue Sep 24, 2020 · 3 comments
Closed

How can I migrate helpers/Modifiers.php #69

joevallender opened this issue Sep 24, 2020 · 3 comments

Comments

@joevallender
Copy link

joevallender commented Sep 24, 2020

I've just installed a fresh Statamic v3 and migrated my v2 site into it.

The script ran without any errors but when I visit the site I get Statamic\Modifiers\ModifierNotFoundException

I noticed with a grep that no automatic action had been taken on the file at site/helpers/Modifiers.php

It's no big deal to copy/change/reimplement myself, but in the documentation at https://statamic.dev/modifiers the 'build your own' link doesn't go anywhere. And nothing is noted in https://statamic.dev/upgrade-guide

How are Modifiers handled in v3? Thanks!

@jesseleite
Copy link
Member

jesseleite commented Sep 24, 2020

Yeah nothing has been done on that front yet (closing this as it's a duplicate of #26).

Anyway, check out https://statamic.dev/extending/modifiers#creating-a-modifier. A little bit has changed, but not much.
Maybe use the make:modifier command to generate your modifier classes, then paste your logic into them 👍

@joevallender
Copy link
Author

Thanks, I can confirm that all works. Used the command to create a new file in app/Modifiers and was able to paste the existing modifier function across, changing its previously unique name to the index() function of what is now unique files. Cheers!

joevallender added a commit to joevallender/docs-1 that referenced this issue Sep 25, 2020
jackmcdade pushed a commit to statamic/docs that referenced this issue Sep 25, 2020
@jesseleite
Copy link
Member

@joevallender glad to hear!

superstar1205 added a commit to superstar1205/lc that referenced this issue Aug 21, 2022
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