Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21395

Using Symfony DIC from legacy combined with legacyKernel->runCallback(...) causes some serious issues.

    XMLWordPrintable

    Details

      Description

      https://confluence.ez.no/display/EZP51/Legacy+code+and+features#Legacycodeandfeatures-UsingeZPublish5andSymfonyfeaturesinLegacy

      If the controller executed makes use of runLegacyCallback, things will get ugly.

      Real example: Legacy calls a controller which uses eZFind and thus also runCallback.

          public function runCallback( \Closure $callback, $postReinitialize = true )
          {
              $this->enterLegacyRootDir();
              $return = parent::runCallback( $callback, $postReinitialize );
              $this->leaveLegacyRootDir();
              return $return;
          }
      

      The culprit can been seen here. First one enters the legacy-directory, and all is good. Then leaveLegacyRootDir() puts the script in the web-directory. The remaining legacy code executed after the Symfony-controller will then be executed within the wrong working directory. This causes all sorts of fun to happen. Crashing code, ini-cache-corruption...

      The ini-cache corruption causes the setup-wizard to be displayed; even in an production environment. Needless to say, this is very much unwanted.

      The code above should simply store the current working-directory and then restore it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              whitefire Henning Kvinnesland
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: