Answer the question
In order to leave comments, you need to log in
Can't see packages in MODX revo?
Hello! Installed MODX Revo on XAMPP. I go to the Package Installer, but there is no search. Packages are not displayed at all, it's stupid Loading .... and that's it. Who faced such problem? cURL enabled
Answer the question
In order to leave comments, you need to log in
This question often pops up, but no one ever gives a solution.
It's all about the php version. At the minimum required 5.3, everything started to load.
I faced. It just went away after a few hours. As I understand it, these are problems on the server side from which the extensions are downloaded.
Also faced such a problem. Used OpenServer. As Alexander Gamov wrote, it worked after changing the php version to 5.3, but I still had to change HTTP to Apache v.2.2
In modx file \core\xpdo\xpdo.xpdo.class.php
Replace existing similar code with:
/**
* Converts a PHP array into a JSON encoded string.
*
* @param array $array The PHP array to convert.
* return string The JSON representation of the source array.
*/
public function toJSON($array) {
$encoded= '';
if (is_array ($array)) {
if (!function_exists('json_encode')) {
if (@ include_once (XPDO_CORE_PATH . 'json/JSON.php')) {
$json = new Services_JSON();
$encoded= $json->encode($array);
}
} else {
$array = self::arrayEncodeUTF8($array);
$encoded= json_encode($array);
}
}
return $encoded;
}
public static function arrayEncodeUTF8($array){
foreach($array as $key => $value){
if(!is_array($value) && is_string($value)){
json_encode($value);
if(json_last_error() == 5){
$array[$key] = iconv('CP1251', 'UTF-8', $value);
}
} else {
$array[$key] = self::arrayEncodeUTF8($value);
}
}
return $array;
}
It worked for me.
Described in detail here: https://forums.modx.com/thread/?thread=98775
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question