nliautaud / p01contact

Create contact forms by writing simple tags. Also a plugin for GetSimple and Pico CMS.
MIT License
16 stars 15 forks source link

Pico gives HTTP 500 error with p01contact #30

Closed sonst-was closed 6 years ago

sonst-was commented 6 years ago

Hi,

after I had a few problems installing the new version of Pico I wanted to try your contact plugin (one of the reason why I updated the German translation) but I'm no facing another HTTP 500 Error.

I downloaded the code, uploaded the p01-contact folder and renamed it to PicoContact. Afterwards Pico replies with a HTTP 500 Error code and the error log says:

[Mon Feb 19 09:13:24.739487 2018] [proxy_fcgi:error] [pid 19690:tid 140345144690432] [client 62.143.162.45:55494] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught LogicException: Unable to add function "contact" as extensions have already been initialized. in /home/webmxxp3h/html/something/pico2/vendor/twig/twig/lib/Twig/Environment.php:1262\nStack trace:\n#0 /home/webmxxp3h/html/something/pico2/plugins/PicoContact/PicoContact.php(86): Twig_Environment->addFunction('contact')\n#1 /home/webmxxp3h/html/something/pico2/vendor/picocms/pico/lib/AbstractPicoPlugin.php(117): PicoContact->onPageRendering(Object(Twig_Environment), Array, 'index.twig')\n#2 /home/webmxxp3h/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(857): AbstractPicoPlugin->handleEvent('onPageRendering', Array)\n#3 /home/webmxxp3h/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(688): PicoDeprecated->triggerEvent(1, 'onPageRendering', Array)\n#4 /home/webmxxp3h/html/something/pico2/vendor/picocms/pico/lib/AbstractPicoPlugin.php(117): PicoDeprecated->onPageRendering('index.twig', Array)\n#5 /home/webmxxp3h/html/something/pi...\n'

[Mon Feb 19 09:17:08.087594 2018] [proxy_fcgi:error] [pid 19689:tid 140345102726912] [client 62.143.162.45:42644] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught LogicException: Unable to add function "contact" as extensions have already been initialized. in /home/webmxxp3h/html/something/pico2/vendor/twig/twig/lib/Twig/Environment.php:1262\nStack trace:\n#0 /home/webmxxp3h/html/something/pico2/plugins/PicoContact/PicoContact.php(86): Twig_Environment->addFunction('contact')\n#1 /home/webmxxp3h/html/something/pico2/vendor/picocms/pico/lib/AbstractPicoPlugin.php(117): PicoContact->onPageRendering(Object(Twig_Environment), Array, 'index.twig')\n#2 /home/webmxxp3h/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(857): AbstractPicoPlugin->handleEvent('onPageRendering', Array)\n#3 /home/webmxxp3h/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(688): PicoDeprecated->triggerEvent(1, 'onPageRendering', Array)\n#4 /home/webmxxp3h/html/something/pico2/vendor/picocms/pico/lib/AbstractPicoPlugin.php(117): PicoDeprecated->onPageRendering('index.twig', Array)\n#5 /home/webmxxp3h/html/something/pi...\n'

Any help would be appreciated!

Kind regards sonst-was

nliautaud commented 6 years ago

Hi, thanks for the report. Seems to be similar to https://github.com/nliautaud/pico-pages-list/issues/16 I'll take a look.

nliautaud commented 6 years ago

Pico 2 plugins API have been slightly changed. Added a pico-2.0 branch. See 61d0a27106095344983245b067f14dad3f39f9c9 or https://github.com/nliautaud/p01contact/pull/36