-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Custom logic_hooks deleted when redeploying module #105
Comments
You should specify exactly the paths and file names where you created the logic hook. And the contents. Having a minimum reproducible example of the bug helps make triage much faster and more precise. Thanks for reporting! |
Hey,
The content of the files doesn't matter, but that's what I have: logic_hooks.php:
|
Thanks. Isn't this problem solved by just setting things up in a different folder, one that doesn't get overwritten by Module builder? It would be more correct to do it elsewhere, I think. The logic hook definition probably goes in And the actual class file can be anywhere (the definition points to the file), for example |
Hey, |
The custom directory includes parts that are read, and parts that are written to. So there is definitely some overwriting going on when people get confused about what-goes-where. And sometimes it can get confusing... The Module builder is a different beast. I never use it. Other people recommend using it only once (initially), then doing the rest by editing files. Sometimes it seems to assume that it is the only thing doing changes in the custom module, as if there were no manual changes (but typically, there are). I think Studio is more respectful of manual changes, although you still need to know where to put your own stuff. I would just advise to avoid sweeping assumptions, and try to figure out all behaviors one by one (logic hooks are not like vardefs; Module builder is not like Studio; etc), until you achieve something satisfactory. If you like to go under the hood and really understand what is happening I recommend this. |
Issue
I placed the following files in the folder public/legacy/custom/modules/custom_ModuleName:
After redeploying a custom module from the module builder the logic hook files were deleted from the server.
Expected Behavior
I would expect that the files that were manually created would stay on the server.
Actual Behavior
The logic_hook.php and all additional php files related to the logic hooks are deleted.
Possible Fix
Making the logic hook files read-only could fix the issue. Otherwise it would be good to keep them when the module is redeployed.
Steps to Reproduce
Context
I had to change some things in the module, but those changes were unrelated to the logic hook. After that I wanted to adapt the logic hook and couldn't find the files anymore.
This entry on the support forum sounds like the same issue I am facing, but I couldn't find the issue they are referring to.
Your Environment
The text was updated successfully, but these errors were encountered: