After updating EE to 2.10.. I have a blank (500 error) when i try to edit a member!

I tried to

  • flush all the cache,
  • Create and edit new member
  • Other browser

Any ideas?

Thanks!

UPDATE:

I replaced /expressionengine/controllers/myaccount.php with the 2.9.3 version and it's working..

  • Glad you found a solution, Benoit. Please go ahead and post your solution by answering your own question. It will mark this question as answered and may help other users, too. – Alex Kendrick May 1 '15 at 15:19
  • I wouldn't recommend being an early adopter!! And if you are, do what Benoit did, figure it out yourself and report it EllisLab! – jrothafer May 1 '15 at 17:20
  • Yea, it doesn't help that EllisLabs only offer you download of 2.8.3 or latest (2.10.0) though. It would be nice if they gave us version history downloads too... – Blatant May 4 '15 at 13:47
up vote 1 down vote accepted

I believe I've found the answer.

If you want the quickest, non core file modifying answer, then it is simply Upgrade to PHP5.5 or better! Otherwsie read on...

Basically this all comes down to PHP Version. The actual issue is in the file /system/expressionengine/controllers/cp/myaccount.php as the OP suggests. The function at fault is update_signiture() and the line numbers are 1358 to 1365. Excerpt :

    // Do we have what we need in $_POST?
    if (empty(ee()->input->post('signature'))
        && empty(ee()->input->post('remove'))
        && (empty($_FILES) && ee()->config->item('sig_allow_img_upload') == 'y'))
    {
        return ee()->functions->redirect(
            cp_url('myaccount/edit_signature', $params)
        );
    }

Do you notice the function calls within the empty() statements? Well, according to the PHP Documentation on empty(), and I quote :

Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

SO, armed with this knowledge the fix is quite straigh forward. If you are using PHP < 5.5 you need to patch this statement, unfortunatly the advise on php.net will also cause the WSOD error, but what you can do is call the 2 ee()->input->post() functions prior to the if statement and test the result, or to make it easier update the code to the following :

    // Do we have what we need in $_POST?
    $sig = ee()->input->post('signature');
    $rem = ee()->input->post('remove');
    if (empty($sig) 
        && empty($rem) 
        && (empty($_FILES) && ee()->config->item('sig_allow_img_upload') == 'y'))
    {
        return ee()->functions->redirect(
            cp_url('myaccount/edit_signature', $params)
        );
    }

There you go, tested on a fresh install, that should get you rocking and rolling.

In point of fact, in EE 2.9.3 this code chunk is as so :

    // Do we have what we need in $_POST?
    if ( ! ee()->input->post('signature')
        && ! ee()->input->post('remove'))
    {
        return ee()->functions->redirect(
            cp_url('myaccount/edit_signature', $params)
        );
    }

So while the workaround (use myaccount.php from EE 2.9.3) will work, you are removing the added security checks for empty($_FILES) and ee()->config->item('sig_allow_img_upload') == 'y'. Either solution is as adaquate as the other IMHO, as either method results in core file changes. However if you use myaccount.php from an older version I would consider adding those 2 extra checks in so you don't lose any desired patch work EllisLabs have contributed.

I have submitted this bug to EllisLabs here : https://support.ellislab.com/bugs/detail/20954 , as they state the PHP requirment for 2.10.0 is PHP 5.3.10 or newer, either they can patch this function or change the requirement to >PHP5.5.

Hope this helps someone on the bleeding edge of EE!

In order to regain the missing Account Edit screens, all you need to do is go into CP, then Member -> Preferences and update the Allow New Member Registrations? field to Yes.

I am just looking at why this effects the edit account screen now. I will add to my answer (and submit a bug report to EllisLabs, as you can replicate this behaviour out the box, fresh install) once I've ironed out why the My Account screen is now linked to the Allow New Member preference.

  • Hold fire, After installation, updating this setting allows the page to display, but now I've changed member preferences again and it's blank again! Bear with me I'm mining through the code now... – Blatant May 1 '15 at 16:30
  • Update, it seems the issue is somewhere in the signiture functions within myaccount.php, still debugging but if you remove update_signature() and edit_signature() you get the functionality back! – Blatant May 1 '15 at 16:54
  • I have it! There is a PHP quirks happening here. Updating my answer now. – Blatant May 1 '15 at 17:05
  • Well, following the bug report, EllisLabs have released a new version of EE (2.10.1) WIth this bug and a couple of others fixed. ellislab.com/expressionengine/user-guide/about/…. Happy days. – Blatant May 5 '15 at 12:22

I found a solution/workaround...

I replaced /expressionengine/controllers/myaccount.php with the 2.9.3 version and it's working..

  • That is a work around :) I am able to replicate your issue, and I am working on a fix that doesn't involve breaking/changing core files. Just let me confirm it and I'll post it. – Blatant May 1 '15 at 16:21
  • Seems I couldn't avoid modifying core files, however my answer explains how to do it withou removing patched code from EE 2.9.3 to 2.10.0 – Blatant May 1 '15 at 17:27

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.