Extension talk:ArticleToCategory2

Schlagmichdoch (talkcontribs)

When using the current version with php 7.4 we got a bug whenever a category page is visited.

On top of the body following error message is printed:

<b>Notice</b>:  Uninitialized string offset: 0 in <b>/var/www/wiki/extensions/ArticleToCategory2/ArticleToCategory2Hooks.php</b> on line <b>49</b><br>

To fix this we need to change the File ArticleToCategory2Hooks.php:

                               foreach ( $c as $entry ) {
                                       if ( $entry[0] == ';' ) {
                                               $cat = trim( substr( $entry, 1 ) );
                                               $excludedCategories[] = $cat;
                                       }
                               }

Must be changed into:

                               foreach ( $c as $entry ) {
                                       if ( !empty($entry) && $entry[0] == ';' ) {
                                               $cat = trim( substr( $entry, 1 ) );
                                               $excludedCategories[] = $cat;
                                       }
                               }
Reply to "Bug"

InputBox not appearing?

2
Magnulu (talkcontribs)
Kghbln (talkcontribs)

Appears to be strange indeed. Perhaps you ask Miraheze staff to look into this closer.

Reply to "InputBox not appearing?"

Excluded Categories fix

3
Summary by Kghbln

Committed with 40b6c3159300800a3e2ed5bb814772196c6ee092. Users of MW 1.33+ however need to use the version for MW 1.35+

Schlagmichdoch (talkcontribs)

the flag $wgarticletocategory2ConfigBlacklist = true; is not working by default. To make it work again the following workaround should be good enough:

  1. The flag in LocalSettings.pgp is actually camelcased. Change it to $wgArticleToCategory2ConfigBlacklist = true;
  2. The extension than uses a hook that is long deprecated and leading to a error on every category page (Info). Therefore go to line 40 in ArticleToCategory2.hooks.php and change

           $content = $rev->getText();

to:

           $content = ContentHandler::getContentText($rev->getContent());

Afterwords everthing should be working fine.

Kghbln (talkcontribs)
Kghbln (talkcontribs)
Summary by Kghbln

Fixed with 39be8f5315448771efa2c0037d3613fcfe7a85f4. Users of MW 1.33+ however need to use the version for MW 1.35+

Schlagmichdoch (talkcontribs)

When I tried to activate the extension with the new mediawiki 1.35 I got an Error on each Category Page.


Blame is to be attributed to ArticleToCategory2.hooks.php again.

There is a typo in line 77 right after // MW 1.33+

It needs to be

!$permManager->quickUserCan

instead of:

!$permManagare->quickUserCan


Cheers

Kghbln (talkcontribs)
There are no older topics