Last modified: 2010-05-15 16:03:17 UTC
Hello, On my wiki (1.12), when I update page using Task extension (which has some hooks on page saving or something like that), I got the error : Fatal error: Using $this when not in object context in /home/.../includes/Parser.php on line 563 Line 563: (version 1.12) $marker = "$uniq_prefix-$element-" . sprintf('%08X', $n++) . $this->mMarkerSuffix; Looking at line 563... it's extractTagsAndParams method which is marked as static. and the line 563 call $this->mMarkerSuffix Who coded that ? :D
Created attachment 4768 [details] Move private variable mMarkerSuffix to constant MARKER_SUFFIX This patch converts the private variables $this->mMarkerSuffix to constant self::MARKER_SUFFIX so it can be accessed statically.
Created attachment 4772 [details] Replace all occurances of mMarkerSuffix with MARKER_SUFFIX Do it to Preprocessor classes as well.
One bad instance of MARK_SUFFIX in the last patch, and the use of single quotes lost the special char and caused some failures. Fixed... now passes parser tests. :D Applied in r32486
Applied on 1.12 branch in r32487, will be in 1.12.1.
*** Bug 13591 has been marked as a duplicate of this bug. ***
Created attachment 4899 [details] Updated patch to preserve the Edit Section Links After applying the patch for this bug all my edit section links disappeared. If found out that this patch removed some curly braces from the regular expressions. I have fixed this in the uploaded patch.
They are not regular expressions but just strings where $this->parser->mMarkerSuffix was replaced by its value. We have to use curly braces to tell PHP that the whole $this->parser->mMarkerSuffix should be replace and not just $this because "-" is not a valid char in variables names.