getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.59k stars 1.41k forks source link

The list of pages is not displayed after updating Admin v1.10.7 (Grav v1.7.8) #3280

Closed petira closed 3 years ago

petira commented 3 years ago

Is it possible that after updating to Grav v1.7.8 - Admin v1.10.7 the list of pages (/admin/pages) is not displayed? That is exactly what happened to me. Everything else works, including editing pages after entering a direct path (/admin/pages/anypage).

Before I look for another cause of the problem, has it happened to someone else?

tonhaarmans commented 3 years ago

Yes, happens to me too!

rhukster commented 3 years ago

What browser ?

tonhaarmans commented 3 years ago

Google Chrome on Windows 10

tonhaarmans commented 3 years ago

It's not on all sites. I am now working on localhost with the 2015 theme. Another site that I updated this morning does show the pages...

tonhaarmans commented 3 years ago

Same sites that does not show pages on localhost does show it online...

derhamproductions commented 3 years ago

I'm also experiencing the same problem, updated my local dev to 1.7.8 and admin 1.10.7. In Chrome and Firefox (both latest builds)

If I disable flex objects -> directories -> pages(admin) I can access the pages again

petira commented 3 years ago

Chrome and Edge, localhost, Windows 10.

I did not try to update productive sites.

tonhaarmans commented 3 years ago

Yes, disabling flexobjects makes the pages visible

rhukster commented 3 years ago

In the last update of the admin i changed the layout so that it uses a CSS calc() to use the full height of the browser rather than the fixed height it had before. I'm 'guessing' this has something to do with it. But it works fine for me in all my testing in both Chrome and Firefox.

Are you guys seeing any JS errors? or perhaps CSS is blocking it showing? A screenshot might be helpful.

Also maybe try clearing browser cache or hard-reloading the page?

aricooperdavis commented 3 years ago

I'm experiencing this too. There is an AJAX error:

"error":{
  "type":"Error",
  "message":"Call to a member function toString() on null",
  "code":0,
  "file":"D:\\XAMPP\\htdocs\\grav-morgan\\system\\src\\Grav\\Common\\Flex\\Types\\Pages\\PageIndex.php",
  "line":530
}

And the log contains the stack-trace:

grav.CRITICAL: Call to a member function toString() on null - Trace: 
#0 ...\system\src\Grav\Common\Flex\Types\Pages\PageIndex.php(324): Grav\Common\Flex\Types\Pages\PageIndex->getLevelListingRecurse(Array) 
getgrav/grav-plugin-admin#1 ...\system\src\Grav\Common\Flex\Types\Pages\PageObject.php(497): Grav\Common\Flex\Types\Pages\PageIndex->getLevelListing(Array) 
getgrav/grav-plugin-admin#2 ...\user\plugins\flex-objects\classes\Admin\AdminController.php(662): Grav\Common\Flex\Types\Pages\PageObject->getLevelListing(Array) 
getgrav/grav-plugin-admin#3 ...\user\plugins\flex-objects\classes\Admin\AdminController.php(1274): Grav\Plugin\FlexObjects\Admin\AdminController->actionListLevel() 
getgrav/grav-plugin-admin#4 ...\user\plugins\flex-objects\flex-objects.php(271): Grav\Plugin\FlexObjects\Admin\AdminController->execute() 
getgrav/grav-plugin-admin#5 ...\vendor\symfony\event-dispatcher\EventDispatcher.php(264): Grav\Plugin\FlexObjectsPlugin->onAdminPageInitialized(Object(RocketTheme\Toolbox\Event\Event), 'onPageInitializ...', Object(Symfony\Component\EventDispatcher\EventDispatcher)) 
getgrav/grav-plugin-admin#6 ...\vendor\symfony\event-dispatcher\EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
getgrav/grav-plugin-admin#7 ...\vendor\symfony\event-dispatcher\EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
getgrav/grav-plugin-admin#8 ...\system\src\Grav\Common\Grav.php(556): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(RocketTheme\Toolbox\Event\Event), 'onPageInitializ...') 
getgrav/grav-plugin-admin#9 ...\system\src\Grav\Common\Processors\PagesProcessor.php(44): Grav\Common\Grav->fireEvent('onPageInitializ...', Object(RocketTheme\Toolbox\Event\Event)) 
getgrav/grav-plugin-admin#10 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\PagesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#11 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#12 ...\system\src\Grav\Common\Processors\TwigProcessor.php(38): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#13 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\TwigProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#14 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#15 ...\system\src\Grav\Common\Processors\AssetsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#16 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\AssetsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#17 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#18 ...\system\src\Grav\Common\Processors\SchedulerProcessor.php(40): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#19 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\SchedulerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#20 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#21 ...\system\src\Grav\Common\Processors\BackupsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#22 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\BackupsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#23 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#24 ...\system\src\Grav\Common\Processors\TasksProcessor.php(69): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#25 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\TasksProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#26 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#27 ...\user\plugins\admin\classes\plugin\Router.php(51): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#28 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Plugin\Admin\Router->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#29 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#30 ...\system\src\Grav\Common\Processors\RequestProcessor.php(63): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#31 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\RequestProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#32 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#33 ...\system\src\Grav\Common\Processors\ThemesProcessor.php(38): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#34 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\ThemesProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#35 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#36 ...\system\src\Grav\Common\Processors\PluginsProcessor.php(39): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#37 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\PluginsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#38 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#39 ...\system\src\Grav\Common\Processors\InitializeProcessor.php(130): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#40 ...\system\src\Grav\Common\Debugger.php(546): Grav\Common\Processors\InitializeProcessor::Grav\Common\Processors\{closure}() 
getgrav/grav-plugin-admin#41 ...\system\src\Grav\Common\Processors\InitializeProcessor.php(131): Grav\Common\Debugger->profile(Object(Closure)) 
getgrav/grav-plugin-admin#42 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(50): Grav\Common\Processors\InitializeProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) 
getgrav/grav-plugin-admin#43 ...\system\src\Grav\Framework\RequestHandler\Traits\RequestHandlerTrait.php(62): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#44 ...\system\src\Grav\Common\Grav.php(295): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) 
getgrav/grav-plugin-admin#45 ...\index.php(58): Grav\Common\Grav->process()

I can't pin it down to any specific page, but removing all pages fixes it.

mahagr commented 3 years ago

@petira @tonhaarmans @aricooperdavis Can you please try with the above patch?

It will fix the spinning wheel, but it will not fix the cause. In the list view, try to find pages with no visible route under the title. Please let me know what you find, I'm assuming that you will see it in some of the translated pages, but I do not know why.

tonhaarmans commented 3 years ago

Oops, no idea how to apply the patch. Never done that before. Perhaps I'll wait till there is a real update?

mahagr commented 3 years ago

The second commit is accidental, I had the wrong comment in it.

Just replace system/src/Grav/Common/Flex/Types/Pages/PageIndex.php with this.

petira commented 3 years ago

Yes, this fix resolves the issue. The list of pages is displayed. Thank you.

Philemon23 commented 3 years ago

The second commit is accidental, I had the wrong comment in it.

Just replace system/src/Grav/Common/Flex/Types/Pages/PageIndex.php with this.

This helped me too, thanks! I guess we can expect new realese fixing this soon?

izumitelj commented 3 years ago

It is NOT fixed :(

There is another problem. With patch, pages do load, but if I try to edit any page and save I get "Save Failed: Cannot reorder a page which has no parent". Under Advanced tab there are no Sortable pages listed.

If I disable Flex plugin everyting works fine!

izumitelj commented 3 years ago

I've just tried clean install of latest release from the repo grav-admin-v1.7.8.zip. Admin panel doesn't display pages and if I access page directlly (or apply previous patch) – pages can't be saved Save Failed: Cannot reorder a page which has no parent. Also no pages are listed under Advanced/Ordering.

My envoronent is localhost, Windows FF and Chrome.

I believe this is urgent, bacause the main release doesn't work.

TheDuffman85 commented 3 years ago

I ran into this problem yesterday, on my first time ever install of Grav. This issue cost me many hours and was driving me crazy. I thought it is a problem with my environment. I agree with @izumitelj that it's urgent to make an emergency release. Also I would recommend to withdraw v1.7.8.

TheDuffman85 commented 3 years ago

Also I can confirm the second issue "Save Failed: Cannot reorder a page which has no parent". I had this after applying the fix. Solution for me was to downgrade to Grav v1.7.7.

izumitelj commented 3 years ago

Can confirm this workaround – downgrading Grav to 1.7.7. restores the functionality. Admin and Flex Objects plugin can stay at their latest versions.

mahagr commented 3 years ago

Can someone who's brave enough to upgrade (test site) help me on figuring out what causes this bug?

Please ping me in discord, I need either a working example or someone who I can talk with to go through what happens. Thanks!

paulhibbitts commented 3 years ago

@mahagr If it helps, I just tried to update two Grav sites to 1.7.8 and no issues - here is my PHP info:

PHP Version 7.3.24
PHP Version 7.3.23

Please let me know if any other config info might be useful.
Paul

rhukster commented 3 years ago

it must be something specific to a setting or configuration option, a plugin, or perhaps a custom blueprint. Could be anything at this point but it's certainly impacting 'some' people and not all. I can't reproduce it either. We need details about a setup that is causing it, or better yet, a ZIP file of a test instance where it occurs so we can dig in and find out what causes it.

TheDuffman85 commented 3 years ago

I did a clean install using a skeleton with admin. After the encounter of this problem I started over and cloned from Git and installed the dependencies with compose. But the error was the same.

My environment: PHP 7.4.16 IIS 10 Windows Server 2019

The skeleton I used first: https://getgrav.org/download/skeletons/twentyfifteen-site/1.0.3-admin

izumitelj commented 3 years ago

I did clean install from https://github.com/getgrav/grav/releases/download/1.7.8/grav-admin-v1.7.8.zip

After creating Admin account, pages don't load and I can't edit any through Admin panel.

My environment is: Laragon local development environment (Windows) PHP 7.4.15. Nginx 1.14.0

tonhaarmans commented 3 years ago

website.zip I just discovered I can also upload here... It's a site I am developing for my daughter. I have it on localhost (Laragon webserver, PHP 7.4 on Windows 10)

paulhibbitts commented 3 years ago

Can now see it too on my Windows 10 Surface, PHP 4.7.1 and have DM'd Matias.

Console screenshot:

2021-03-19_11-52-17
rhukster commented 3 years ago

@tonhaarmans i'm assuming you didn't apply the patch yet? I tried your site locally in Chrome and it works fine. I can list he pages no problem. The only issue I see is that during save in the blog posts, it throws an error related to date format. I changed from your day/year to a full date and it saves fine.

CleanShot 2021-03-19 at 12 54 17@2x

izumitelj commented 3 years ago

Three of us that provided details experience this on Windows machines. And if I copy the same site (that doesn't work localy) to the server – than it works.

rhukster commented 3 years ago

@paulhibbitts can you open up the "network" panel and click "XHR" to filter the results, then inspect any failed calls and paste the output.

tonhaarmans commented 3 years ago

I didn't apply the patch, because I don't even know how to do that. Maybe it's the webserver? I saw another one who also uses Laragon... BTW, the site works fine online...

izumitelj commented 3 years ago

@paulhibbitts can you open up the "network" panel and click "XHR" to filter the results, then inspect any failed calls and paste the output.

@rhukster ... not @paulhibbitts ;) but here is what I see there:

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. pages
XHRPOSThttp://gravvv.test/admin/update.json/task:getUpdates
[HTTP/1.1 200 OK 833ms]

XHRPOSThttp://gravvv.test/admin/task:getNotifications
[HTTP/1.1 200 OK 401ms]

XHRPOSThttp://gravvv.test/admin/pages
[HTTP/1.1 500 Internal Server Error 450ms]

POST
    http://gravvv.test/admin/pages
Status500
Internal Server Error
VersionHTTP/1.1
Transferred685 B (199 B size)
Referrer Policystrict-origin-when-cross-origin

    Cache-Control
        no-store, no-cache, must-revalidate
    Connection
        keep-alive
    Content-Type
        application/json
    Date
        Fri, 19 Mar 2021 19:13:25 GMT
    Expires
        Thu, 19 Nov 1981 08:52:00 GMT
    Pragma
        no-cache
    Server
        nginx/1.14.0
    Set-Cookie
        grav-site-9b4e02d-admin=bfptag5c41pic8a6b0cgebe02i; expires=Fri, 19-Mar-2021 19:43:25 GMT; Max-Age=1800; path=/; domain=gravvv.test; HttpOnly; SameSite=Lax
    Transfer-Encoding
        chunked
    X-Powered-By
        PHP/7.4.15

    Accept
        */*
    Accept-Encoding
        gzip, deflate
    Accept-Language
        en-US,en;q=0.5
    Connection
        keep-alive
    Content-Length
        36
    Content-Type
        application/x-www-form-urlencoded; charset=UTF-8
    Cookie
        grav-site-9b4e02d-admin=bfptag5c41pic8a6b0cgebe02i; grav-admin-flexpages=eyJmaWx0ZXJzIjp7fX0%3D
    DNT
        1
    Host
        gravvv.test
    Origin
        http://gravvv.test
    Referer
        http://gravvv.test/admin/pages
    User-Agent
        Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
    X-Requested-With
        XMLHttpRequest

Response

JSON
    error   Object { type: "Error", message: "Call to a member function toString() on null", code: 0, … }
    type    "Error"
    message "Call to a member function toString() on null"
    code    0
    file    "C:\\laragon\\www\\gravvv\\system\\src\\Grav\\Common\\Flex\\Types\\Pages\\PageIndex.php"
    line    530

Response Payload

    {"error":{"type":"Error","message":"Call to a member function toString() on null","code":0,"file":"C:\\laragon\\www\\gravvv\\system\\src\\Grav\\Common\\Flex\\Types\\Pages\\PageIndex.php","line":530}}
paulhibbitts commented 3 years ago

Thanks @izumitelj , I see an error with Network -> XHR but unable to get to that log. I see jquery at the front of the item.

mahagr commented 3 years ago

Changing those 2 lines from the above commit (click on the number in the right side) will fix the issue in Windows.

izumitelj commented 3 years ago

I can confirm this fixes the issue in my case! Thanks 👍