samuelet / indexmenu

A dokuwiki plugin to show a customizable and sortable index for a namespace.
http://dokuwiki.org/plugin:indexmenu
GNU General Public License v2.0
44 stars 43 forks source link

JSON / PHP 7 issue PHP Failed opening required inc/JSON.php #220

Closed Juergen-Vollmer closed 3 years ago

Juergen-Vollmer commented 4 years ago

Hi,

I'm using dokuwiki "Hogfather" and "indexmenu" (2020-06-02) together with php 7.2.5 and get the following error:

PHP Fatal error: require_once(): Failed opening required '..../dokuwiki/lib/exe/../../inc/JSON.php' (include_path='.:/usr/share/php7:/usr/share/php7/PEAR') in ...../dokuwiki/lib/plugins/indexmenu/action.php on line 160

In order to fix that I have to change in the file dokuwiki/lib/plugins/indexmenu/action.php the following function:

function _ajax_call(&$event, $param) {… 
  ....
/* old code
   require_once DOKU_INC.'inc/JSON.php';
   $json = new JSON();
   echo ''.$json->encode($data).'';
  */
// new code
echo ''.json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR|JSON_NUMERIC_CHECK).'';

.... }

Jürgen

id027102 commented 4 years ago

Delete line 160 in action.php also solve the problem , no other change needed

Klap-in commented 4 years ago

Todos:

Klap-in commented 3 years ago

Current state works fine. Code quality will improve with #230.