From ac025fdf5b089dec593b4ad733ab6a12f70617c0 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 14 Apr 2018 08:50:30 +0200
Subject: [PATCH] fallback for new section editing. fixes #2311

The displayed message now shows the target that was passed, which should
help identifying the troubling plugin.

Instead of failing, we fix the data ourselves - this code will be
removed in the future.
---
 inc/parser/xhtml.php | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index df436e0e6..bcc949111 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -77,8 +77,19 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      */
     public function startSectionEdit($start, $data) {
         if (!is_array($data)) {
-            msg('startSectionEdit: $data is NOT an array!', -1);
-            return '';
+            msg(
+                sprintf(
+                    'startSectionEdit: $data "%s" is NOT an array! One of your plugins needs an update.',
+                    hsc((string) $data)
+                ), -1
+            );
+
+            // @deprecated 2018-04-14, backward compatibility
+            $args = func_get_args();
+            $data = array();
+            if(isset($args[1])) $data['target'] = $args[1];
+            if(isset($args[2])) $data['name'] = $args[2];
+            if(isset($args[3])) $data['hid'] = $args[3];
         }
         $data['secid'] = ++$this->lastsecid;
         $data['start'] = $start;
-- 
GitLab