Last modified: 2010-05-15 16:03:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15522, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13522 - Fatal error in Parser::extractTagsAndParams static method using $this
Fatal error in Parser::extractTagsAndParams static method using $this
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.13.x
All All
: Normal critical (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
: 13591 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-26 16:53 UTC by iubito (Sylvain Machefert)
Modified: 2010-05-15 16:03 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Move private variable mMarkerSuffix to constant MARKER_SUFFIX (3.17 KB, patch)
2008-03-26 17:14 UTC, Robert Leverington
Details
Replace all occurances of mMarkerSuffix with MARKER_SUFFIX (4.67 KB, patch)
2008-03-26 23:35 UTC, Robert Leverington
Details
Updated patch to preserve the Edit Section Links (4.68 KB, patch)
2008-05-13 15:21 UTC, Erik Hansen
Details

Description iubito (Sylvain Machefert) 2008-03-26 16:53:22 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
Comment 1 Robert Leverington 2008-03-26 17:14:07 UTC
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.
Comment 2 Robert Leverington 2008-03-26 23:35:23 UTC
Created attachment 4772 [details]
Replace all occurances of mMarkerSuffix with MARKER_SUFFIX

Do it to Preprocessor classes as well.
Comment 3 Brion Vibber 2008-03-27 00:01:00 UTC
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
Comment 4 Brion Vibber 2008-03-27 00:03:07 UTC
Applied on 1.12 branch in r32487, will be in 1.12.1.
Comment 5 Brion Vibber 2008-04-02 19:40:37 UTC
*** Bug 13591 has been marked as a duplicate of this bug. ***
Comment 6 Erik Hansen 2008-05-13 15:21:04 UTC
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.
Comment 7 Alexandre Emsenhuber [IAlex] 2008-05-13 15:36:41 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links