2016-10-13 10 views
0

Я ищу решение для одного из моих предупреждений.PHP Предупреждение: отсутствует аргумент 1 для sfOutputEscaperGetterDecorator :: get(), вызванный в

информация

система: ОС: FreeBSD двигателя: Nginx + PHP-FPM CMS: Sympfony 1,4

Проблема заключается в том, когда я пытаюсь перечислить данные на бэкэнд Symfony Home Я получаю следующее сообщение об ошибке и данные не могут вместо этого отображать необработанные данные (ссылка exp. на учетную запись пользователя), но не для всех, где ничего не отображается.

[ошибка] 7716 # 100111: * 1288 FastCGI послал в STDERR: «PHP сообщения: PHP Предупреждение: Отсутствует аргумент 1 для sfOutputEscaperGetterDecorator :: получить(), называемый в/данных/бен/кэш/бэкэнд/прод /modules/autoSfGuardUser/templates/_list_td_tabular.php в строке 2 и определен в /data/bin/lib/symfony/escaper/sfOutputEscaperGetterDecorator.class.php в строке 45 PHP-сообщение: PHP Warning: array_key_exists(): первый аргумент должен быть строкой или целым числом в /data/bin/lib/symfony/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php на линии 1357

Файл:/данные/бен/Библиотека/Symfony/беглец/sfOutputEscaperGetterD ecorator.class.php

<?php 

    /* 
    * This file is part of the symfony package. 
    * (c) 2004-2006 Fabien Potencier <[email protected]> 
    * 
    * For the full copyright and license information, please view the LICENSE 
    * file that was distributed with this source code. 
    */ 

    /** 
    * Abstract output escaping decorator class for "getter" objects. 
    * 
    * @see  sfOutputEscaper 
    * @package symfony 
    * @subpackage view 
    * @author  Mike Squire <[email protected]> 
    * @version SVN: $Id: sfOutputEscaperGetterDecorator.class.php 9047 2008-05-19 08:43:05Z FabianLange $ 
    */ 
    abstract class sfOutputEscaperGetterDecorator extends sfOutputEscaper 
    { 
     /** 
     * Returns the raw, unescaped value associated with the key supplied. 
     * 
     * The key might be an index into an array or a value to be passed to the 
     * decorated object's get() method. 
     * 
     * @param string $key The key to retrieve 
     * 
     * @return mixed The value 
     */ 
     public abstract function getRaw($key); 

     /** 
     * Returns the escaped value associated with the key supplied. 
     * 
     * Typically (using this implementation) the raw value is obtained using the 
     * {@link getRaw()} method, escaped and the result returned. 
     * 
     * @param string $key    The key to retieve 
     * @param string $escapingMethod The escaping method (a PHP function) to use 
     * 
     * @return mixed The escaped value 
     */ 
     public function get($key, $escapingMethod = null) 
     { 
     if (!$escapingMethod) 
     { 
      $escapingMethod = $this->escapingMethod; 
     } 

     return sfOutputEscaper::escape($escapingMethod, $this->getRaw($key)); 
     } 
    } 

ответ

0

Я нашел проблему и решение. Проблема была в preg_replace, и я изменил ее, как описано здесь Symfony 1.4 deprecated function in php

Но это не сработает до очистки кеша symfony. Я удаляю все (папки и файлы) в кеше папки (/ data/bin/cache).

P.S. Полезной была ссылка http://blog.jakoubek.cz/symfony-1-4-deprecated-e-modifier.