ampache / ampache

A web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.
http://ampache.org
GNU Affero General Public License v3.0
3.49k stars 590 forks source link

Error on Top Tracks #3680

Closed fufroma closed 9 months ago

fufroma commented 9 months ago

Description

Describe the bug

On Artist page, the Top Tracks link does not work.

To reproduce

Steps to reproduce the behavior:

  1. Go to https://play.dogmazic.net/index.php#artists.php?action=show&artist=6990
  2. Click on Top Tracks
  3. Nothing happen

Technical

There is an ajax call https://play.dogmazic.net/server/ajax.server.php?page=index&action=top_tracks&artist=6990 with error 500

When I enabled the php debug :

$ curl "https://play.dogmazic.net/server/ajax.server.php?page=index&action=top_tracks&artist=6990"
[...]  
            <tr id="song_64068">
                <!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><head><style>body{font-family:sans-serif}</style><title>
PhpTal\Exception\VariableNotFoundException: Unable to find variable 'IS_ALBUM_GROUP' in current scope</title></head><body><h1>PHPTAL Exception</h1><p><strong>
Unable to find variable 'IS_ALBUM_GROUP' in current scope</strong></p><p>In /opt/play.dogmazic.net/vendor/scn/phptal/src/Context.php line 351</p><pre>
#0 /opt/play.dogmazic.net/vendor/scn/phptal/src/PHPTAL.php(849) : eval()'d code(117): PhpTal\Context-&gt;__get()
#1 /opt/play.dogmazic.net/vendor/scn/phptal/src/PHPTAL.php(659): tpl_65509fc4_song_row__0A6AzWcwT9sUUoVxUpDNqQ()
#2 /opt/play.dogmazic.net/src/Gui/TalView.php(59): PhpTal\PHPTAL-&gt;execute()
#3 /opt/play.dogmazic.net/public/templates/show_top_tracks.inc.php(114): Ampache\Gui\TalView-&gt;render()
#4 /opt/play.dogmazic.net/src/Application/Api/Ajax/Handler/IndexAjaxHandler.php(102): require_once('...')
#5 /opt/play.dogmazic.net/src/Application/Api/Ajax/AjaxApplication.php(90): Ampache\Application\Api\Ajax\Handler\IndexAjaxHandler-&gt;handle()
#6 /opt/play.dogmazic.net/public/server/ajax.server.php(38): Ampache\Application\Api\Ajax\AjaxApplication-&gt;run()
#7 {main}</pre></body></html>            

Nota :

Environment

fufroma commented 9 months ago

Oops may be related to https://github.com/ampache/ampache/commit/6dc68bdabf7345c60a0cb475cf0217d2cf1de5d4

fufroma commented 9 months ago

Yes it's fixed in the dev branch :)

lachlan-00 commented 9 months ago

yup, it was annoying me that there wasn't anything in the log but it was simply just failing to load the variable into the template.