开发者

Drupal 7 and Classified Ads module error

开发者 https://www.devze.com 2023-02-04 08:34 出处:网络
i\'m testing drupal 7 with the Classified Ads module but after module installation, i got a boring error :

i'm testing drupal 7 with the Classified Ads module but after module installation, i got a boring error :

  • Notice: Constant REQUEST_TIME already defined in include_once() (line 34 of /var/www/chri/sites/all/modules/ed_classified/ed_classified.module).

When i took a look at the php code i wasn't able to find the problem cause the following functio开发者_C百科n is not supposed to define REQUEST_TIME if already defined...

/*
 * 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
}

Any suggestion ?


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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消