BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

ContextErrorException in LocalizedFrontend.php line 27: Notice: Undefined index: requirements #180

Closed yawicz closed 5 years ago

yawicz commented 5 years ago

Hi @bobdenotter ,

It's me again, unfortunately faster than expected. This time, it's gonna be a bit shorter since I didn't have enough time to try and find a solution by myself yet, thus I will temporarily revert back to 4.1.1 and add my manual fix again to try to get my project up and running again.

Problem

After I updated to your new release 4.1.3, I now get the following error and my project is broken again: ContextErrorException in LocalizedFrontend.php line 27: Notice: Undefined index: requirements

  1. in /var/www/bolt/.../extensions/vendor/animal/translate/src/Frontend/LocalizedFrontend.php line 27
  2. at ErrorHandler->handleError('8', 'Undefined index: requirements', '/var/www/bolt/.../extensions/vendor/animal/translate/src/Frontend/LocalizedFrontend.php', '27', array('routes' => array('homepage' => array('path' => '/', 'defaults' => array('_controller' => 'controller.frontend:homepage')), 'search' => array('path' => '/search', 'defaults' => array('_controller' => 'controller.frontend:search')), 'preview' => array('path' => '/preview/{contenttypeslug}', 'defaults' => array('_controller' => 'controller.frontend:preview'), 'requirements' => array('contenttypeslug' => 'controller.requirement:anyContentType'), 'methods' => array('POST')), 'contentlink' => array('path' => '/{contenttypeslug}/{slug}', 'defaults' => array('_controller' => 'controller.frontend:record'), 'requirements' => array('contenttypeslug' => 'controller.requirement:anyContentType')), 'taxonomylink' => array('path' => '/{taxonomytype}/{slug}', 'defaults' => array('_controller' => 'controller.frontend:taxonomy'), 'requirements' => array('taxonomytype' => 'controller.requirement:anyTaxonomyType')), 'contentlisting' => array('path' => '/{contenttypeslug}', 'defaults' => array('_controller' => 'controller.frontend:listing'), 'requirements' => array('contenttypeslug' => 'controller.requirement:pluralContentTypes'))), 'config' => object(Config), 'requirements' => 'en|de|', 'locale' => object(Locale), 'route' => array('path' => '/', 'defaults' => array('_controller' => 'controller.frontend:homepage')), 'name' => 'homepage')) in LocalizedFrontend.php line 27

Details

Reproduction

If you're filing a bug, please describe how to reproduce it. Include as much relevant information as possible, such as:

  1. Bug summary: After updating from 4.1.1 to 4.1.3, a ContextErrorException appears
  2. Specifics: see above
  3. Steps to reproduce: Update from 4.1.1 to 4.1.3
  4. Expected result: Everything works fine.
  5. Actual result: Installation is broken, have to manually revert back to 4.1.1

In case you need more info, please feel free to contact me anytime.

Best, yawicz

yawicz commented 5 years ago

Short update: Reverting to 4.1.1 and adjusting the /var/www/bolt/main/extensions/vendor/animal/translate/src/Storage/Legacy.php as in my other post from yesterday solves the issue for me. So I guess version 4.1.2 should be working, but something in 4.1.3 seems to be wrong (at least in my setup). Best, yawicz

yawicz commented 5 years ago

Update 2 and Troubleshooting: Going to 4.1.2 via the Bolt-backend results in the same error message. When I adjust the if-statement in line 27 of /var/www/bolt/.../extensions/vendor/animal/translate/src/Frontend/LocalizedFrontend.php, from ... != 'none' to ... ='none', the website shows up again but no matter where I click, it shows error 404 - page not found. But this way I was able to comfortably access the backend again and revert back to version 4.1.1, which resulted in the known ContextErrorException in line 0 of /var/www/bolt/.../extensions/vendor/animal/translate/src/Storage/Legacy.php. After fixing this by adding the missing argument, everything is working fine again. So I'm not sure what else has been modified in the compatibility update from 4.1.1 to 4.1.2 and 4.1.3, but some of the additional changes seem to be causing the new problem. Hope this helps!

Best, yawicz

yawicz commented 5 years ago

Just updated to version 4.1.5 and everything is running smoothly. Bug fixed, thanks!

bobdenotter commented 5 years ago

Glad that it's fixed, and my apologies for not remembering to check open issues to notify people of probable fixed issues. :-)