Admin media, admin saving: unauthorized

Hi,

I’m getting the ol’ Unauthorized message on really basic admin tasks – saving a page, navigating from the page editor to the page list, etc. Is this part of the general unauthorized problem that’s going on? Or is it me? (BTW, the saving of the page is successful. And I’m all up-to-date.)

Also, are page media files supposed to be visible in the page media upload box permanently? When I upload, they appear in the box. The files are saved. However, when I save the page or navigate away and back, the files disappear from the upload box. Makes for a memory test…

Thanks,
Rebecca

One problem at a time. I know you say you are all up to date, but the unauthorized errors are caused by trying to make calls without the appropriate nonces which are used for security purposes.

I would first try to force an update of your Grav version and all your plugins too. The easiest way to to do this is by gpm:

bin/gpm selfupgrade -f
bin/gpm update -f

Then logout of the admin and log back in.

The question regarding media. That is not just an ‘upload box’ it’s a list of media, so yes, they should show up there even after you are done uploading and you go back to the page.

Sorry for doubling up if the problems are unrelated.

You are already running the latest version of Grav (v1.0.0-rc.6) released on Tue Dec  1 20:13:36 2015
Nothing to update.

Still the Unauthorized messages. (And the empty media boxes.)

No one else having these problems? (I feel better when it’s everyone.)

What about the “Admin”, “Login”, “Form”, and “Email” plugins. Also make sure you clear the cache.

Unfortunately it’s only you that is having this problem. Everyone else seems to have moved beyond this with updating everything to latest versions.

Hmm.

[2015-12-07 20:05:26] grav.CRITICAL: Template "media.html.twig" is not defined. - Trace: #0 C:\xampp\htdocs\grav\system\src\Grav\Common\Grav.php(157): Grav\Common\Twig\Twig->processSite(NULL) #1 C:\xampp\htdocs\grav\vendor\pimple\pimple\src\Pimple\Container.php(113 ): Grav\Common\Grav::Grav\Common\{closure}(Object(Grav\Common\Grav)) #2 C:\xampp\htdocs\grav\system\src\Grav\Common\Grav.php(258): Pimple\Container->offsetGet('output') #3 C:\xampp\htdocs\grav\index.php(37): Grav\Common\Grav->process() #4 {main} [] []
$ find . -name media\*
./system/blueprints/config/media.yaml
./system/blueprints/media
./system/config/media.yaml
./system/images/media
./user/plugins/admin/pages/admin/media.md
./user/plugins/admin/themes/grav/templates/media.json.twig

Am I supposed to have a media.html.twig? (Or is media.md supposed to flow through media.json.twig?)

There is no support for a media page type, eg media.html.twig in either Antimatter or the admin plugin. I don’t know what theme your are running, or how you are getting a reference to that template unless you created a page called media.md. If that’ sthe case then you would need to create an appropriate media.html.twig to handle it.

The JSON file is used by the admin to get the status of the media files associated with the page. It’s an Ajax call, so it uses a JSON template.

I really appreciate your responsiveness. Thanks!

I didn’t make that media.md file, but renaming it does eliminate the Unauthorized problem. For me, the file comes in the admin download. Unless I’m crazy? bin/gpm uninstall admin and then bin/gpm install admin and the media.md is there.

So media.json.twig is my place to start wrt the empty media box?

There is a file called media.md in the admin plugin to display those media files, but that is inside the plugin itself: user/plugins/admin/pages/media.md

This should not effect your site however and i’m not able to replicate the issue when saving pages, it just works, no errors.

Try clearing your browser cache BTW, it might be JS that is cached in the browser that is causing you issues.

No luck yet on my end. Thanks for trying.
Yes, media.md is in the admin plugin only.
user/plugins/admin/pages/admin/media.md

Added an issue.

Yah i saw the issue, please read my reply. I know what the problem is. i’ve left it for flavio to look at when he wakes up in a few hours.