Skip to content

Commit

Permalink
Fix unknown array key errors; Add alexdraconian as an author
Browse files Browse the repository at this point in the history
  • Loading branch information
jaller94 committed May 30, 2023
1 parent 59f33fb commit ef94f81
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* @author Andy Webber <dokuwiki at andywebber dot com>
* @author Federico Ariel Castagnini
* @author Cyrille37 <cyrille37@gmail.com>
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Matthias Schulte <dokuwiki@lupo49.de>
* @author Rik Blok <rik dot blok at ubc dot ca>
* @author Christian Paul <christian at chrpaul dot de>
* @author alexdraconian <78018187+alexdraconian@users.noreply.github.com>
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
Expand All @@ -31,17 +32,17 @@ function _get_page_data() {
$pages = array();
foreach($all_pages as $pageid) {
$pages[$pageid] = array("exists"=>page_exists($pageid), "links"=>0);
}
}

foreach($all_pages as $pageid) {

if (!page_exists($pageid)) continue;

$relation_data = p_get_metadata($pageid)['relation']['references'];
$relation_data = p_get_metadata($pageid, 'relation references', METADATA_DONT_RENDER);
if (!is_null($relation_data)) {
foreach($relation_data as $name => $exist) {
$pages[$name]['exist'] = $exist;
$pages[$name]['links'] += 1;
foreach($relation_data as $name => $exists) {
$pages[$name]['exists'] = $exists;
$pages[$name]['links'] = isset($pages[$name]['links']) ? $pages[$name]['links'] + 1 : 1;
}
}
}
Expand Down Expand Up @@ -126,7 +127,7 @@ function orph_report_table($data, $page_exists, $has_links, $params_array, $call

foreach($data as $id=>$item) {

if( ! (($item['exists'] == $page_exists) and (($item['links'] <> 0)== $has_links)) ) continue ;
if( ! ((array_key_exists('exists', $item)) and ($item['exists'] == $page_exists) and (array_key_exists('links', $item)) and (($item['links'] <> 0)== $has_links)) ) continue ;

// $id is a string, looks like this: page, namespace:page, or namespace:<subspaces>:page
$match_array = explode(":", $id);
Expand Down

0 comments on commit ef94f81

Please sign in to comment.