Jump to content

Twitchy editing


bear

Recommended Posts

For anyone making changes to the WHMCS interface via hooks, it's a very twitchy process, at least for those of us that aren't heavily invested in learning the latest language/framework being used. Wanted to alter the garish colors used in the infobar on the admin dashboard (hot pink, really?), so created a hook to load a custom CSS for the admin area. In the dev install, it worked just as expected, so I brought it over to the live install. 
I'm greeted with "OOPS, something went wrong", and nothing else. sigh.
After trying a few things that didn't help, set it to display the errors causing it to fall over. Seems I had another hook created a long while ago that loaded a custom CSS file. Trying to (accidentally) declare that a second time caused the compile to abort badly. Easy fix, but leaves me REALLY gun shy about changes to the live site.

Don't really need anything other than to say to the folks behind coding WHMCS...please come up with a more graceful way to fail? If it's a conflict for the same thing, perhaps load neither one, and let us know something's up with maybe a popup/fade in stating "hey, there's a problem in your hooks that needs fixing" rather then nuke the page/site?

Link to comment
Share on other sites

20 minutes ago, bear said:

I'm greeted with "OOPS, something went wrong", and nothing else. sigh.

as you know, you'd need display errors enabled - but ideally you don't keep it on in a production setting.

20 minutes ago, bear said:

After trying a few things that didn't help, set it to display the errors causing it to fall over. Seems I had another hook created a long while ago that loaded a custom CSS file. Trying to (accidentally) declare that a second time caused the compile to abort badly. Easy fix, but leaves me REALLY gun shy about changes to the live site.

that's a known issue, e.g having two hook functions with the same name... generally, i'd suggest keeping the number of separate hook files to a minimum and where possible grouping them together... e.g navbar/sidebar hooks together, admin hooks together etc..  that way you're going to know what you've already got and where to edit to add new ones.

i'd class that as a bug with your memory rather than the hook! 📝

20 minutes ago, bear said:

Don't really need anything other than to say to the folks behind coding WHMCS...please come up with a more graceful way to fail? If it's a conflict for the same thing, perhaps load neither one, and let us know something's up with maybe a popup/fade in stating "hey, there's a problem in your hooks that needs fixing" rather then nuke the page/site?

I doubt you'd see anything like that until v8, and probably not even then... that said, it's always worth reiterating the sheer stupidity of the need to use hooks to fix the most trivial of things with WHMCS... can WHMCS not spend 3 seconds adding a link to a custom css in their admin templates?

Link to comment
Share on other sites

8 hours ago, brian! said:

that's a known issue, e.g having two hook functions with the same name

Hadn't noticed the name was the same, but you're right. At least it makes sense now. they were two different hook files, but the name in it was the same. 
Guess I need to keep track of what I name the functions and calls in these and make sure none get duplicated. 

Onward! (thanks, Brian!)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated