Last modified: 2014-05-04 19:50:11 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 T48249, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46249 - Use of undefined constant CONTENT_MODEL_JAVASCRIPT / CONTENT_MODEL_CSS with 1.20 branch of SyntaxHighlight(GeSHi) and MW 1.20
Use of undefined constant CONTENT_MODEL_JAVASCRIPT / CONTENT_MODEL_CSS with 1...
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-17 21:18 UTC by webpaul
Modified: 2014-05-04 19:50 UTC (History)
6 users (show)

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


Attachments

Description webpaul 2013-03-17 21:18:13 UTC
Notice: Use of undefined constant CONTENT_MODEL_CSS - assumed 'CONTENT_MODEL_CSS' in /SyntaxHighlight_GeSHi.php on line 75 
Notice: Use of undefined constant CONTENT_MODEL_JAVASCRIPT - assumed 'CONTENT_MODEL_JAVASCRIPT' in SyntaxHighlight_GeSHi.php on line 76 

Code not compatible with php 5.32 and mediawiki 1.20.3
Comment 1 Andre Klapper 2013-03-17 23:30:23 UTC
Which problems does this create which make the "code not compatible"? 
Looks like these are just warnings?
Comment 2 Sam Reed (reedy) 2013-03-18 02:37:50 UTC
(In reply to comment #1)
> Which problems does this create which make the "code not compatible"? 
> Looks like these are just warnings?

It depends on the ContentHandler code added in 1.21 (?).

Do note, we generally don't support "master" of extensions to work with random older versions of mediawiki
Comment 3 Sam Reed (reedy) 2013-03-18 02:38:44 UTC
Even more so when we have a branched version for 1.20 https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SyntaxHighlight_GeSHi.git;a=log;h=refs/heads/REL1_20
Comment 4 genericonlinepostings 2013-04-01 20:37:08 UTC
Sam, and everyone else who has contributed, 
Thank you for making such a great feature available.  

I'm seeing the same problem originally reported by webpaul.  I see Sam's comments about 1.21 being required, but this appears to be an alpha version of Mediawiki.  I installed the 1.20 branch of SyntaxHighlight(GeSHi) but received the same errors.  In reviewing the change log of the branch, I don't see any mention of this problem so I don't believe the problem was addressed there.  Is there something else that I can try to avoid the error messages from appearing?

Problem Description:
After installing and configuring SyntaxHighlight(GeSHi), Errors appear on all wiki pages when running PHP 5.3 and Mediawiki 1.20 and using the latest SyntaxHighlight(GeSHi).
Comment 5 Andre Klapper 2013-04-02 07:56:27 UTC
1.21 is alpha (and will be stable in about six weeks). You might get the same issue in 1.20 as "It depends on the ContentHandler code added in 1.21 (?)". So I'd say best to wait a few weeks here.
Comment 6 Elad Yosifon 2013-04-06 15:21:06 UTC
those notices are being generated for no actual reason (the code that uses those constants is commented out)..
I think that it's a quick hotfix and does not depend on anything..

file: $IP\extensions\SyntaxHighlight_GeSHi\SyntaxHighlight_GeSHi.php
=====================================================================
just wrap CONTENT_MODEL_CSS (line 75) and CONTENT_MODEL_JAVASCRIPT (line 76) with quotes and you're good to go..
Comment 7 Sam Reed (reedy) 2013-04-06 15:52:57 UTC
(In reply to comment #6)
> those notices are being generated for no actual reason (the code that uses
> those constants is commented out)..

It's certainly not in master
Comment 8 Stas Fomin 2013-07-09 21:55:21 UTC
Why this bug marked as "RESOLVED INVALID"?

Will this simple bug (to add just couple of quotes for PHP compatibility) be fixed in this repo, or all have to fork the repo to fix it?
Comment 9 Andre Klapper 2013-07-09 23:04:20 UTC
Stas: You might want to start with explaining which MediaWiki version and which version (branch) of SyntaxHighlight_GeSHi you use.
You can find the reason for closing by clicking "History" in the upper right corner.
Comment 10 Andre Klapper 2013-07-10 10:26:48 UTC
Oops, I didn't mean to close this again.
Comment 11 Stas Fomin 2013-07-10 16:43:05 UTC
* MediaWiki 1.8 (but it is not important)
* Latest SyntaxHighlight_GeSHi (from master branch, but all branches have same problem)

---------------
$wgSyntaxHighlightModels = array(
   CONTENT_MODEL_CSS => 'css',
   CONTENT_MODEL_JAVASCRIPT => 'javascript',
);
---------------
PHP sees this syntax, but it throws an E_NOTICE,
* which has some performance overhead. 
* writes a lot of spam in the log (or spam in console, if we run maintenance scripts, or even spam in HTML output if we debugging and "display_errors = On" in php.ini).

And it is not OK, see 
"Why is $foo[bar] wrong?" in official PHP documentation
http://php.net/manual/en/language.types.array.php
Comment 12 Sam Reed (reedy) 2013-07-10 17:48:27 UTC
MediaWiki 1.8!?
Comment 13 Stas Fomin 2013-07-10 20:15:27 UTC
Sorry, MW 1.18, of course. It does not matter.
Comment 14 Bartosz Dziewoński 2014-05-04 19:50:11 UTC
1.18 is not supported by the git master version of SyntaxHighlight anymore. 
You can use an older version instead.

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


Navigation
Links