Pregunta

Estoy probando Drupal 7 con los anuncios clasificados módulo, pero después de la instalación del módulo, tengo un error aburrido:

  • Aviso: REQUEST_TIME Constant ya definido en include_once () (línea 34 de /var/www/chri/sites/all/modules/ed_classified/ed_classified.module).

Cuando tomé un vistazo al código php yo no era capaz de encontrar la causa del problema la siguiente función no se supone para definir REQUEST_TIME si ya se ha definido ...

/*
 * Drupal 7 provides REQUEST_TIME as time of start of request. This
 * is more efficient than using time() every time. Adopted here.
 */
if (!defined(REQUEST_TIME)) {
  define('REQUEST_TIME', time()); //LINE 34
}

Cualquier sugerencia?

¿Fue útil?

Solución

Looks like Drupal 6 code that was up-ported to Drupal 7, but they forgot to remove it. Should be safe just to remove that chunk of code. Be sure to also file an issue in the module's issue queue and/or provide a patch so everyone else can benefit from your fix!

Otros consejos

The main problem of that code is that it is actually wrong. defined() recieves a string, not a constant. That's why it doesn't work as expected.

So, as Dave said, fill a bug report for the module, this needs to be fixed for 6.x (it is causing a E_NOTICE there) and 7.x.

This fix was included some weeks ago as part of the rework of ed_classified module, now in branches 6.x-3.x and 7.x-3.x

If you still find issues with it, please report them on the module issue queue: it will help more people than asking on S.E., and you may get an actual module fix instead of a local patch.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top