Extension talk:Favorites

About this board

addGoodLinkObj() Error, unable to load Special:FavoriteList

1
SylvanianClub (talkcontribs)

Hello, I am getting this error when trying to access Special:FavoriteList. Thank you for any assistance.

/Special:Favoritelist Error: Call to undefined method MediaWiki\Cache\LinkCache::addGoodLinkObj()

Backtrace:

from [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(278)
#0 [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(359): ViewFavorites->getFavoritelistInfo(MediaWiki\User\User)
#1 [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(340): ViewFavorites->buildRemoveList(MediaWiki\User\User)
#2 [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(147): ViewFavorites->showNormalForm(MediaWiki\Output\OutputPage, MediaWiki\User\User)
#3 [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(127): ViewFavorites->viewFavList(MediaWiki\User\User, MediaWiki\Output\OutputPage, MediaWiki\Request\WebRequest, boolean)
#4 [filepath]/extensions/Favorites/includes/specials/SpecialFavoritelist.php(30): ViewFavorites->wfSpecialFavoritelist(NULL)
#5 [filepath]/includes/specialpage/SpecialPage.php(719): SpecialFavoritelist->execute(NULL)
#6 [filepath]/includes/specialpage/SpecialPageFactory.php(1669): MediaWiki\SpecialPage\SpecialPage->run(NULL)
#7 [filepath]/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#8 [filepath]/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#9 [filepath]/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#10 [filepath]/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#11 {main}

Reply to "addGoodLinkObj() Error, unable to load Special:FavoriteList"

File "extension.json" doesn't exist in 1.34

4
WhitWye (talkcontribs)

The error begins: "Fatal error: Uncaught Exception: Unable to open file /var/www/mediawiki-1.34.0/extensions/Favorites/extension.json ... and indeed the only .json files in the Favorites folder (from the current tar download) are composer.json, gitinfo.json, package-lock.json and package.json. Should one of those be symlinked as "extension.json"?


Note that was with the new way. The old spec of 'require_once "$IP/extensions/Favorites/Favorites.php";' doesn't error out on that nonexistent file, but instead, "

No such action


The action specified by the URL is invalid. You might have mistyped the URL, or followed an incorrect link. This might also indicate a bug in the software used by eiswiki.

Lwangaman (talkcontribs)

I am now trying to install the Favorites extension. When I run the "php update.php" in the maintenance folder I get the same error:

PHP Fatal error: Uncaught Exception: Unable to open file /var/www/vhosts/.../extensions/Favorites/extension.json: filemtime(): stat failed for /var/www/vhosts/.../extensions/Favorites/extension.json in /var/www/vhosts/.../includes/registration/ExtensionRegistry.php:136 Stack trace:

  1. 0 /var/www/vhosts/.../includes/GlobalFunctions.php(52): ExtensionRegistry->queue()
  2. 1 /var/www/vhosts/.../LocalSettings.php(177): wfLoadExtension()
  3. 2 /var/www/vhosts/.../includes/Setup.php(124): require_once('/var/www/vhosts...')
  4. 3 /var/www/vhosts/.../maintenance/doMaintenance.php(83): require_once('/var/www/vhosts...')
  5. 4 /var/www/vhosts/.../maintenance/update.php(277): require_once('/var/www/vhosts...')
  6. 5 {main}
 thrown in /var/www/vhosts/.../includes/registration/ExtensionRegistry.php on line 136

Anyone have a fix?

2403:AC00:0:1001:0:0:2:5C9E (talkcontribs)

请问你解决了吗?

188.27.50.189 (talkcontribs)

To fix the issue, you'll need to comment the following line, inside the LocalSettings.php file.

require_once( "$IP/includes/DefaultSettings.php" );

Reply to "File "extension.json" doesn't exist in 1.34"

"an error occurred ..." MW 1.35.4, 1.35.5

16
2003:C2:3F1C:100:A11D:7FB3:D263:8A51 (talkcontribs)

MW 1.35.4, PHP 7.4.24


Howdy,

when clicking "+Favorite", a small message box appears "An error occurred when changing the favorites setting for ..."

By activating the debug options in LocalSettings, I find the following log entry in the Apache error log:

AH01071: Got error 'PHP message: PHP Deprecated:  Use of InternalParseBeforeSanitize hook (used in VariablesHooks::onInternalParseBeforeSanitize) was deprecated in MediaWiki 1.35. [Called from MediaWiki\\HookContainer\\HookContainer::run in [........]/mediawiki/includes/HookContainer/HookContainer.php at line 132] in [........]/mediawiki/includes/debug/MWDebug.php on line 430', referer: [...page name.....]


Anyone else having the same problem? What can I do to find out more ?

Ciencia Al Poder (talkcontribs)
2003:C2:3F1C:100:A11D:7FB3:D263:8A51 (talkcontribs)

... not really. The network tab shows an answer of "200" on a post request, and the detailed view tells me:

{"error":{"code":"internal_api_error_Error","info":"[ad70de264e45ab8a9f92a964] Caught exception of type Error","errorclass":"Error"}}

so it seems the extension itself handles an exception. All well-known debug options in LocalSettings are set, the Mediawiki log file is empty.

2003:C2:3F1C:100:A11D:7FB3:D263:8A51 (talkcontribs)

In PHP, deprecation warnings are off:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

but this seemingly does not work as Apache reports the warnings as "AH01071 Got error".

Ciencia Al Poder (talkcontribs)
2003:C2:3F1C:100:3946:3285:873C:3F66 (talkcontribs)

$wgShowExceptionDetails = true and I thought it had been so before ... after some try&error, I still can't find no stacktrace nowhere, neither in the Mediawiki log nor in the Apache logfile. But eventually the browser network viewer tab tells me a little bit more:


"internal_api_error_Error"

"[792bf7348e100b98b656ca9a] Exception caught: Call to undefined method ApiFavorite::dieUsageMsg()"

"Error at [.......]/extensions/Favorites/api/ApiFavorite.php(41)\n

#0 [.......]/includes/api/ApiMain.php(1593): ApiFavorite->execute()\n

#1 [.......]/includes/api/ApiMain.php(529): ApiMain->executeAction()\n

#2 [.......]/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()\n

#3 [.......]/api.php(90): ApiMain->execute()\n

#4 [.......]/api.php(45): wfApiMain()\n

#5 {main}"


Obviously part of our installation is outdated, the extension or some of the core functions. Mediawiki = 1.35.4, PHP = 7.4.3, Favorites = 1.1.3 (downloaded few days ago via ExtensionDistributor). Do I have the wrong extension version?

2003:C2:3F1C:100:3946:3285:873C:3F66 (talkcontribs)

ApiFavorites line 29-42:

               if ( $params['unfavorite'] ) {

                       $res['unfavorited'] = '';

                       $res['message'] = $this->msg( 'removedfavoritetext', $title->getPrefixedText() )->title( $title )->parseAsBlock();

                       $success = false;

                       //$success = UnfavoriteAction::doUnfavorite( $title, $user );

               } else {

                       $res['favorited'] = '';

                       $res['message'] = $this->msg( 'addedfavoritetext', $title->getPrefixedText() )->title( $title )->parseAsBlock();

                       $success = false;

                       //$success = FavAction::doFavorite( $title, $user );

               }

               if ( !$success ) {

                       $this->dieUsageMsg( 'hookaborted' );

               }


$success is always st to false!?

Ciencia Al Poder (talkcontribs)
2003:C2:3F1C:100:9464:F8C6:FD5E:F88F (talkcontribs)

Sadly I see. Repairing the code is far beyond my skill. I hope someone someday will take the necessary steps.


Many thanks for your support.

Gota de agua (talkcontribs)

i test the extension and i thought it was the problem due to the use of the Titlemovecomplete hook that was removed in mediawiki 1.37, so I left a warning on the extension page but I see that it is something else, if someone could make a patch in gerrit I would be grateful because the extension is still interesting

Rdrg109 (talkcontribs)

I'm having the same issue using Mediawiki 1.38.4-1, mariadb 10.9.3-3, PHP 8.1.12-2.

Gota de agua (talkcontribs)

The extension now have a patch for fix that problems

Gota de agua (talkcontribs)
2003:C2:3F21:FD00:134:BD68:4409:6542 (talkcontribs)

Patch is your answer? Really? What a joke.

The documentation page states the extension is stable. I can either download via Extension Distributor or I can use the git repository download. In either case I get an extension that does not work, problems are the same as described above. We have a test installation of 1.39 now, nothing has changed, problems are the same. as with 1.35.

I don't have the knowledge to apply a patch nor am I willing to learn that. You are distributing an extension that crashes, you are able to patch, so why won't you just correct that piece of software so that the extension distributor and the git repository are up do date.

No words could express what I'm feeling. Ground control to spaceship Mediawiki, please do your job then I'll do mine.

Ciencia Al Poder (talkcontribs)

Jobs are normally paid. However, in the Open Source ecosystem, most work is unpaid and volunteer, so this is not anyone's job to do. You got what you paid for.

2003:C2:3F21:FD00:134:BD68:4409:6542 (talkcontribs)

You're right. Everyone get what they paid for. Nothing is for free.

Reply to ""an error occurred ..." MW 1.35.4, 1.35.5"
Kodaren (talkcontribs)

There seems to be a bug in the 1.1.3 favorites extension.

-- If I add a favorite to my favorites list and then view my favorites, I can successfully see my favorite I just added.

-- If I then select Edit raw favorites, I can see the raw text of my favorite I just added. Copy that text, then delete it and select Update favorites button, then view your favorites from my favorites link. You should now have no favorites (if this was initially your only one you added like I did in my case).

-- From there, select Edit raw favorites, past in the raw text of your favorite and then select Update favorites button.

-- Select view and edit favorites to see your favorites and you end up with an error (Internal error) something like this:

[2302d489c484acd6ac97a5f7] 2021-11-01 17:46:08: Fatal exception of type "Error"

-- Go back to Edit raw favorites list and remove this raw text you just pasted and select Update favorites button and view favorites. Things now work again with no error.


This seems like a weird case to try, but this issue is because of Favorites upgrade from 1.1.2 to 1.1.3. Once I upgrade, I can't see any of my favorites because I get an error like the above. If I go into Edit raw favorites list, I can see my favorites, but I can't view outside of raw mode. If I delete all the raw text and Update my favorites, I don't get any error anymore when looking at my favorites, but of course, now all my favorites are gone. It seems the upgrade and\or the copy and pasting of raw favorites text causes issues and throws this Internal Error.


Any help would be appreciated!!!

Kodaren (talkcontribs)

Ok, seems that the patch work to the .php files are required even though the documentation said 1.36 mediawiki. We are using a newer version, but the updated to FavoritelistEditor.php and SpecialFavoritelist.php are still required and sort of fixes our favorites issue. There is still issues with edit raw and add/removing.

Uvas magicas (talkcontribs)

@Kodaren, the extension have problems with add / remove favorites because the hook TitleMoveComplete was removed in the version stable of mediawiki (1.37) the extension need migrate of the new hook PageMoveComplete

Reply to "Edit raw favorites"
Gota de agua (talkcontribs)
Reply to "hook removed"

missing checkbox for "Add this page to your Favorites" after upgrade

1
Abid.Jaffery (talkcontribs)

Hello All

We just upgraded Mediawiki from version 1.28.0 to 1.36.2

We also updated Favorites extension from version 1.1.2 (7c891a7) to 1.1.3 (b874145)

Before the upgrade / update, there use to be a checkbox that would show up right beside the star on the top of the page.

After the upgrade, we can't see the checkbox to "Add this page to your Favorites.

Can someone help? do we need to configure something. Did we forget to do something in the upgrade.

How can we enable the checkbox to "Add this page to your Favorites" show up again?

Thanks

Reply to "missing checkbox for "Add this page to your Favorites" after upgrade"

Call to a member function getFormattedNsText() on null

1
Summary by Uvas magicas

see the page of the extension, in the instructions of the installation, included the solution for this mistake.

Uvas magicas (talkcontribs)

[e4c2c43c004f9a9a2587068b] /wiki/index.php/Especial:Favoritelist Error: Call to a member function getFormattedNsText() on null

Backtrace:

from /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(362)

#0 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(334): ViewFavorites->getNamespaceHeading(integer)

#1 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(314): ViewFavorites->buildRemoveList(User)

#2 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(119): ViewFavorites->showNormalForm(OutputPage, User)

#3 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(105): ViewFavorites->viewFavList(User, OutputPage, WebRequest, boolean)

#4 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/extensions/Favorites/specials/SpecialFavoritelist.php(27): ViewFavorites->wfSpecialFavoritelist(NULL)

#5 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/includes/specialpage/SpecialPage.php(646): SpecialFavoritelist->execute(NULL)

#6 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/includes/specialpage/SpecialPageFactory.php(1386): SpecialPage->run(NULL)

#7 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/includes/MediaWiki.php(309): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)

#8 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/includes/MediaWiki.php(913): MediaWiki->performRequest()

#9 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/includes/MediaWiki.php(546): MediaWiki->main()

#10 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/index.php(53): MediaWiki->run()

#11 /data/web/a1/eb/4e/laplumaazul.tk/htdocs/wiki/index.php(46): wfIndexMain()

#12 {main}


what should i do?

Mkepler (talkcontribs)

Extension is work, button is work too. But no show "yellow star" icon.

Reply to "Empty Favorit icon"

JS TypeError: Cannot set property 'favorite' of undefined

1
Subfader (talkcontribs)

In MW 1.31.10 LTS I get this console error

 Exception in module-execute in module ext.favorites:
 load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:177 TypeError: Cannot set property 'favorite' of undefined
   at load.php?debug=false&lang=en&modules=ext.favorites|site&skin=monobook&version=1f4gm5l:2
   at mw.loader.implement.addedfavoritetext (load.php?debug=false&lang=en&modules=ext.favorites|site&skin=monobook&version=1f4gm5l:3)
   at runScript (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:162)
   at checkCssHandles (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:162)
   at execute (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:163)
   at handlePending (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:159)
   at markModuleReady (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:161)
   at runScript (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:162)
   at checkCssHandles (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:162)
   at execute (load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=monobook&version=1e4vcjv:163)
Reply to "JS TypeError: Cannot set property 'favorite' of undefined"

No such action in MW 1.32

5
Silkwood (talkcontribs)
Product Version
MediaWiki 1.32.0
PHP 7.2.17-0ubuntu0.18.04.1 (apache2handler)
MariaDB 10.1.38-MariaDB-0ubuntu0.18.04.1

Installed the last version of Favourites and run the maintenance/update.php, I get this error using the extension (i.e. clicking on the star icon):

No such action

The action specified by the URL is invalid. You might have mistyped the URL, or followed an incorrect link. This might also indicate a bug in the software used by ....

and the "mistyped" url is:

https://tunearch.org/w/index.php?title=Harlequin_Tune_(3)&action=favorite&token=8506e116643ceea83a82e35f8987a3ee5ce2b492%2B%5C



Brickscrap (talkcontribs)

I get the same, did you ever find a fix?

Silkwood (talkcontribs)

Unfortunately, not.

Silkwood (talkcontribs)

Did someone find a solution to this problem?

I tried the 1.1.3 version (cloning gerrit repo) but I got the same error: "No such action".

Please help!

Reply to "No such action in MW 1.32"
Return to "Favorites" page.