Информация о компании ПромМаш Тест Метрология Trying to access array offset on null (500 Internal Server Error)

Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Trying to access array offset on null

Exception

ErrorException

Show exception properties
ErrorException {#2570
  #severity: E_WARNING
}
  1. public function getAboutPrinciples() {
  2. $principles = get_field('about_principles');
  3. return (object)[
  4. 'title' => $principles['title'],
  5. 'text' => $principles['text'],
  6. 'title_features' => $principles['principles_features_title'],
  7. 'features' => $principles['principles_features'],
  8. ];
  9. }
  1. * @throws \ErrorException
  2. */
  3. public function handleError($level, $message, $file = '', $line = 0, $context = [])
  4. {
  5. try {
  6. parent::handleError($level, $message, $file, $line, $context);
  7. } catch (Throwable $e) {
  8. if (! apply_filters('acorn/throw_error_exception', true, $e)) {
  9. return false;
  10. }
HandleExceptions->handleError(2, 'Trying to access array offset on null', '/app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php', 37) in /app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php (line 37)
  1. public function getAboutPrinciples() {
  2. $principles = get_field('about_principles');
  3. return (object)[
  4. 'title' => $principles['title'],
  5. 'text' => $principles['text'],
  6. 'title_features' => $principles['principles_features_title'],
  7. 'features' => $principles['principles_features'],
  8. ];
  9. }
  1. * @return array
  2. */
  3. public function override()
  4. {
  5. return [
  6. 'about_principles' => $this->getAboutPrinciples(),
  7. 'about_features' => $this->getAboutFeatures(),
  8. ];
  9. }
  1. *
  2. * @return array
  3. */
  4. protected function merge()
  5. {
  6. [$with, $override] = [$this->with(), $this->override()];
  7. if (! $with && ! $override) {
  8. return array_merge(
  9. $this->extractPublicProperties(),
  10. $this->extractPublicMethods(),
  1. public function compose(View $view)
  2. {
  3. $this->view = $view;
  4. $this->data = new Fluent($view->getData());
  5. $view->with($this->merge());
  6. }
  7. /**
  8. * The merged data to be passed to view before rendering.
  9. *
  1. // Once we have the class and method name, we can build the Closure to resolve
  2. // the instance out of the IoC container and call the method on it with the
  3. // given arguments that are passed to the Closure as the composer's data.
  4. return function () use ($class, $method) {
  5. return $this->container->make($class)->{$method}(...func_get_args());
  6. };
  7. }
  8. /**
  9. * Parse a class based composer name.
in /app/www/releases/130/vendor/illuminate/events/Dispatcher.php -> Illuminate\View\Concerns\{closure} (line 458)
  1. return function ($event, $payload) use ($listener, $wildcard) {
  2. if ($wildcard) {
  3. return $listener($event, $payload);
  4. }
  5. return $listener(...array_values($payload));
  6. };
  7. }
  8. /**
  9. * Create a class based listener using the IoC container.
in /app/www/releases/130/vendor/illuminate/events/Dispatcher.php -> Illuminate\Events\{closure} (line 286)
  1. }
  2. $responses = [];
  3. foreach ($this->getListeners($event) as $listener) {
  4. $response = $listener($event, $payload);
  5. // If a response is returned from the listener and event halting is enabled
  6. // we will just return this response, and not call the rest of the event
  7. // listeners. Otherwise we will add the response on the response list.
  8. if ($halt && ! is_null($response)) {
  1. );
  2. return null;
  3. }
  4. return $this->invokeListeners($event, $payload, $halt);
  5. }
  6. /**
  7. * Broadcast an event and call its listeners.
  8. *
  1. * @param \Illuminate\Contracts\View\View $view
  2. * @return void
  3. */
  4. public function callComposer(ViewContract $view)
  5. {
  6. $this->events->dispatch('composing: '.$view->name(), [$view]);
  7. }
  8. /**
  9. * Call the creator for a given view.
  10. *
  1. // We will keep track of the number of views being rendered so we can flush
  2. // the section after the complete rendering operation is done. This will
  3. // clear out the sections for any separate views that may be rendered.
  4. $this->factory->incrementRender();
  5. $this->factory->callComposer($this);
  6. $contents = $this->getContents();
  7. // Once we've finished rendering the view, we'll decrement the render count
  8. // so that each section gets flushed out next time a view is created and
  1. * @throws \Throwable
  2. */
  3. public function render(callable $callback = null)
  4. {
  5. try {
  6. $contents = $this->renderContents();
  7. $response = isset($callback) ? $callback($this, $contents) : null;
  8. // Once we have the contents of the view, we will flush the sections if we are
  9. // done rendering all views so that there is nothing left hanging over when
  1. <body <?php body_class('body'); ?>>
  2. <?php wp_body_open(); ?>
  3. <?php do_action('get_header'); ?>
  4. <div id="app">
  5. <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  6. </div>
  7. <?php do_action('get_footer'); ?>
  8. <?php wp_footer(); ?>
  9. </body>
include('/app/www/releases/130/web/app/themes/sage/index.php') in /app/www/releases/130/web/wp/wp-includes/template-loader.php (line 106)
  1. *
  2. * @param string $template The path of the template to include.
  3. */
  4. $template = apply_filters( 'template_include', $template );
  5. if ( $template ) {
  6. include $template;
  7. } elseif ( current_user_can( 'switch_themes' ) ) {
  8. $theme = wp_get_theme();
  9. if ( $theme->errors() ) {
  10. wp_die( $theme->errors() );
  11. }
require_once('/app/www/releases/130/web/wp/wp-includes/template-loader.php') in /app/www/releases/130/web/wp/wp-blog-header.php (line 19)
  1. // Set up the WordPress query.
  2. wp();
  3. // Load the theme template.
  4. require_once ABSPATH . WPINC . '/template-loader.php';
  5. }
require('/app/www/releases/130/web/wp/wp-blog-header.php') in /app/www/releases/130/web/index.php (line 6)
  1. <?php
  2. /**
  3. * WordPress View Bootstrapper
  4. */
  5. define('WP_USE_THEMES', true);
  6. require __DIR__ . '/wp/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Trying to access array offset on null

  at /app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php:37
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Trying to access array offset on null', '/app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php', 37, array())
     (/app/www/releases/130/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:49)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError(2, 'Trying to access array offset on null', '/app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php', 37)
     (/app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php:37)
  at App\View\Composers\PageAbout->getAboutPrinciples()
     (/app/www/releases/130/web/app/themes/sage/app/View/Composers/PageAbout.php:26)
  at App\View\Composers\PageAbout->override()
     (/app/www/releases/130/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:93)
  at Roots\Acorn\View\Composer->merge()
     (/app/www/releases/130/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:83)
  at Roots\Acorn\View\Composer->compose(object(View))
     (/app/www/releases/130/vendor/illuminate/view/Concerns/ManagesEvents.php:124)
  at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}(object(View))
     (/app/www/releases/130/vendor/illuminate/events/Dispatcher.php:458)
  at Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('composing: page-about', array(object(View)))
     (/app/www/releases/130/vendor/illuminate/events/Dispatcher.php:286)
  at Illuminate\Events\Dispatcher->invokeListeners('composing: page-about', array(object(View)), false)
     (/app/www/releases/130/vendor/illuminate/events/Dispatcher.php:266)
  at Illuminate\Events\Dispatcher->dispatch('composing: page-about', array(object(View)))
     (/app/www/releases/130/vendor/illuminate/view/Concerns/ManagesEvents.php:177)
  at Illuminate\View\Factory->callComposer(object(View))
     (/app/www/releases/130/vendor/illuminate/view/View.php:188)
  at Illuminate\View\View->renderContents()
     (/app/www/releases/130/vendor/illuminate/view/View.php:159)
  at Illuminate\View\View->render()
     (/app/www/releases/130/web/app/themes/sage/index.php:17)
  at include('/app/www/releases/130/web/app/themes/sage/index.php')
     (/app/www/releases/130/web/wp/wp-includes/template-loader.php:106)
  at require_once('/app/www/releases/130/web/wp/wp-includes/template-loader.php')
     (/app/www/releases/130/web/wp/wp-blog-header.php:19)
  at require('/app/www/releases/130/web/wp/wp-blog-header.php')
     (/app/www/releases/130/web/index.php:6)