We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44418
    • 6 Posts
    Hi guys,

    Hope this is the right section for my post ...

    Scenario/issues:
    We had our MODx website on one host server for a while then recently changed hosts and the website was installed onto the new host server. My colleague said it worked fine for a while then all of a sudden it popped up with a few issues.

    The old server was running PHP Version 5.3.3 and the new server was running this version too, until a PHP update/patch was done. Since that update quite a few errors popped up within MODx Manager, mostly depricated errors and a few Form Builder errors too.

    Errors (10 of them):
    Deprecated: Assigning the return value of new by reference is deprecated in /www/hosts/xxxxxxxxxx/public_html/assets/modules/prec-form-builder/includes/view-functions.php on line 1561
    ... plus 9 more similar to above ...

    All depricated errors fixed:
    I was able to get rid of the depricated errors by changing some code within one of the Manager's view-functions.php file by removing the '&' from the code (read that online):

    From
    $form =& new stdClass();
    To
    $form = new stdClass();

    We were still getting errors concerning the Forms. So we asked our current hosts to 'downgrade' the PHP version back to 5.3.3. They didn't have that version (!!!) so they went with what they had, 5.3.27. After that we went back to our old hosts to ask wether they could reinitialise? some of the MODx files or PHP files (not sure) to get rid of the errors we were getting. I think 'XML' files were involved.

    They also fixed a path that was wrong that still had the old server path present (that was the MachForm Form Builder module)

    Since the update (downgrade of the PHP) everything seemed to work ok. Not quite but so close.

    So. At present, as far as we can see, the only errors now are some weird links being created after, selecting them from within TinyMCE Editor 'Link List' selection. When we view (or PREVIEW) the newly created pages, in the web browser, we get URL links looking something like this (they change with different links created):

    www.ourdomain.co.uk/\"\\\" ... which should say for example ... www.ourdomain.co.uk/work-with-us

    The weird thing is, the old links that were created before the change seem to be ok. It's only the newly created links that seem to be affected. This also goes for any hard coded external web links created within TinyMCE link editor, i.e. if we add, say, www.google.co.uk, in the Link Editor, this will also have those strange characters in it's link URL (when hovered over)

    If any of those weird links are clicked MODx throws you back to the homepage, as default when rogue links are detected I suppose?

    Our MODx Current Setup:
    MODx Evo 1.02 [Version codename rev 6066]
    PHP Version 5.3.27

    You're probably going to say go back to the host providers and get them to fix it. Well they've both now decided to charge an extortion amount to get this fixed and so we're left to sort this out ourselves, or pay the price.

    Is it easy and worth updating Evo MODx to latest version? Will this be safe and Data left intact? PHP will have to be updated too I take it?

    OR, would a reinstall of Evo 1.02 work? and be safe?

    Sorry for the long post but I'm stumped. I'm pretty good with sorting out I.T. issues but get lost on deep code issues.

    Any help would be appreciated.

    cheers,
    Gem
    :)
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sounds like the "magic_quotes_gpc" setting in PHP is on. You need to turn it off.

      You should upgrade your Evo. 1.0.10 is the latest release. That would probably solve 99% of the problems with the newer version of PHP; although the snippets would still need to be patched.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 44418
        • 6 Posts
        Hi Susan,

        Thank you for your reply. You got me on the right track for finding a solution.

        I searched for 'magic_quotes' and found some 'fixes' and although the common ones (changing php.ini & .htaccess) didn't change anything or make a difference. Do they need to be done by our host techy server side properly?

        I did find a code fix though by a person called eclipseTalk. So I copied & pasted his code into the 'config.inc.php' file (under Manager->includes folder).

        That fix seems to fix all newley created links but not previous ones that were created 'before' the update (downgrade) of the PHP. That's not a big issue as there's only a handful of pages that can be re-created with new links added.

        eclipseTalk's Post/Fix:
        https://forums.modx.com/thread/18786/magic-quotes-gpc-show-on-in-manager-but-off-with-phpinfo

        Thanks eclipseTalk wink


        UPGRADING EVO:
        Susan, I appreciate your suggestion on updating Evo to 1.0.10 but we're scared of touching this now, being as it seems to be working (insert quote of famous saying). But we will update to the newer Revo release at a later date. It's just this time of year is crucial for us to have this working, without any issues. So I'm hoping this fix will get us through.

        Would it be a case of re-installing Evo 1.0.10 over the top of 1.02? Update PHP to the latest version first obviously. Will it all work as it should without much headache? Patching of snippets to cope with the new MODx & PHP I understand?

        Thank you again.

        cheers,
        Gem
        :) [ed. note: gemini last edited this post 13 years, 1 month ago.]