2

I upgraded Joomla to 3.8 on a test site and CiviCRM (4.7.24) seemed to work fine. I've now replicated the upgrade on a live server (a different config'd machine but both PHP 5.6.31) and while it seemed ok at first, after logging in as admin, certain Profile Edit & all Contribution CiviCRM pages give an Error 500 (the default Name and Address profile doesn't work - but a custom profile does). Dashboard seems to load fine.

I've checked another Joomla 3.8/Civi 4.6.31 site and am getting the same problem. As I've got a working 3.8/Civi am going to try and figure what's different between the installs, but meantime, thought I'd post in case anyone has something similar or any ideas.

4
  • 1
    This might help civicrm.stackexchange.com/questions/6399/…
    – Demerit
    Sep 27, 2017 at 3:52
  • Thanks - that was very helpful. The error is Fatal error: Call to a member function asort() on null in /var/www/html/~/administrator/components/com_civicrm/civicrm/CRM/Utils/Array.php on line 534'
    – Nic
    Sep 27, 2017 at 10:38
  • Unfortunately that's a pretty generic function that could be called from anywhere. Don't suppose there was a stack trace underneath the error as well?
    – Demerit
    Sep 27, 2017 at 15:11
  • No - unless I can add something else to get that to appear? I'm still waiting on the host to give me full access to the error logs. Meantime I downloaded a copy of the site to MAMP locally and it works fine suggesting this is something specific to the server's setup (the other site with the problem is using the same host)
    – Nic
    Sep 27, 2017 at 15:25

1 Answer 1

3

It turns out this was down to the distribution of BSD on the broken servers was standard USA but PHP needed the PECL international library (https://pecl.php.net/package/intl).

Apparently without it, the collator in Array.php is returning a null rather than an exception and causing the error. But only in Joomla 3.8 it seems.

Dave at Digijuice suggested that ammending Array.php at line 534 as follows could fix the problem - which I include in case of use to anyone, but not sure if the problem is common enough to submit this as a change/issue?

public static function asort($array = array()) {
  $lcMessages = CRM_Utils_System::getUFLocale();

  if ($lcMessages && $lcMessages != 'en_US' && class_exists('Collator')) {
    $collator = new Collator($lcMessages . '.utf8');
      If($collator!==NULL) {
        $collator->asort($array); }
         else {
           asort($array);
         }
       }
    else {
      // This calls PHP's built-in asort().
      asort($array);
    }
return $array;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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