Server error when I try to create a new page

Hi,

I’m using Grav 1.5.1 on a PHP 7.2.9 Apache server and I can no longer create new pages from the admin dashboard.

Getting this error message:

Server Error

Sorry, something went terribly wrong!

0 - Undefined class constant 'DUMP_EXCEPTION_ON_INVALID_TYPE’

For further details please review your logs/ folder, or enable displaying of errors in your system configuration.

Here is the corresponding log entry (/logs/grav.log):

[2018-09-16 10:30:46] grav.CRITICAL: Undefined class constant ‘DUMP_EXCEPTION_ON_INVALID_TYPE’ - Trace: #0 /home/crossfitnn/www/system/src/Grav/Common/Yaml.php(33): Grav\Framework\File\Formatter\YamlFormatter->encode(Array, 20, NULL) #1 /home/crossfitnn/www/user/plugins/admin/classes/admin.php(1485): Grav\Common\Yaml::dump(Array, 20) #2 /home/crossfitnn/www/user/plugins/admin/classes/admin.php(1399): Grav\Plugin\Admin\Admin->getPage(’/actus/hrh’) #3 /home/crossfitnn/www/vendor/twig/twig/lib/Twig/Template.php(677): Grav\Plugin\Admin\Admin->page(true) #4 /home/crossfitnn/www/cache/twig/15/152b6cb693bd72cfd69db35c25406229fcd2ad0b0d6bd8ec3468ecf38e9f680b.php(31): Twig_Template->getAttribute(Object(Grav\Plugin\Admin\Admin), ‘page’, Array, ‘method’) #5 /home/crossfitnn/www/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_dd09398055def0ffb4ffe06385c5fcf6089fc4cf8fd8241377c72ca88f9df87f->doDisplay(Array, Array) #6 /home/crossfitnn/www/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #7 /home/crossfitnn/www/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array) #8 /home/crossfitnn/www/vendor/twig/twig/lib/Twig/Environment.php(363): Twig_Template->render(Array) #9 /home/crossfitnn/www/system/src/Grav/Common/Twig/Twig.php(354): Twig_Environment->render(‘pages.html.twig’, Array) #10 /home/crossfitnn/www/system/src/Grav/Common/Service/OutputServiceProvider.php(27): Grav\Common\Twig\Twig->processSite(‘html’) #11 /home/crossfitnn/www/vendor/pimple/pimple/src/Pimple/Container.php(118): Grav\Common\Service\OutputServiceProvider->Grav\Common\Service{closure}(Object(Grav\Common\Grav)) #12 /home/crossfitnn/www/system/src/Grav/Common/Processors/RenderProcessor.php(19): Pimple\Container->offsetGet(‘output’) #13 /home/crossfitnn/www/system/src/Grav/Common/Grav.php(131): Grav\Common\Processors\RenderProcessor->process() #14 /home/crossfitnn/www/system/src/Grav/Common/Grav.php(370): Grav\Common\Grav->Grav\Common{closure}() #15 [internal function]: Grav\Common\Grav::Grav\Common{closure}(‘render’, ‘Render’, Object(Closure)) #16 /home/crossfitnn/www/system/src/Grav/Common/Grav.php(346): call_user_func_array(Object(Closure), Array) #17 /home/crossfitnn/www/system/src/Grav/Common/Grav.php(132): Grav\Common\Grav->__call(‘measureTime’, Array) #18 /home/crossfitnn/www/index.php(52): Grav\Common\Grav->process() #19 {main} [] []

Do you have an idea on what’s going on? :face_with_raised_eyebrow:

1 Like

Hi,

Same issue for me on Grav 1.5.1 with PHP 7.2.2 when I try to save a page.

I found a solution:

  • remove the user/plugins/admin/vendor
  • run bin/gpm install admin

I don’t know exactly why but I had an old version of Symfony\Component\Yaml in that vendor. Maybe I ran a composer update instead of bin/gpm update :thinking:

2 Likes

Thank you @arzurchris : problem solved! :smiley:

Starting from your message, I first went to see the /user/plugins/admin/vendor directory and reupload all files from FTP (I don’t have a command-line access on that server).

Unfortunately, it wasn’t enough. Thus I went to /vendor/symfony/yaml and found that some files were missing and most of the others were outdated. I uploaded new files from the last archive of Grav core and now everything goes right.

1 Like

Hmm… It worked for 30 seconds… now I have blank pages… :expressionless:

OK… Finally solved (by replacing backed up files and reuploading the new files… can’t explain) ! :slight_smile: