When i return to my site after logging-out and my site is in maintenance mode, I receive this error across the top of the page:

Notice: Use of undefined constant RESP_IMG_RATIO_COOKIE - assumed 'RESP_IMG_RATIO_COOKIE' in /home/account/public_html/drupal/sites/all/modules/resp_img/resp_img.module on line 192

Probably doesn't look too good to visitors. Haven't tested to know if this shows to new visitors or just returning users.

Comments

attiks’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Assigned: Unassigned » jelle_s
jelle_s’s picture

Status: Active » Fixed

fixed in latest dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tfranz’s picture

I have the same error – is the latest DEV stable enough for live-sites?
Or is there an easy hack/ patch for 7.13?
Or should i use 7.x-2.0-beta3 instead?

Thank you for your (quick ;) help!

[EDIT]: Setting the array keys in quotes seems to help (line 192 ff)

    && isset($_COOKIE['RESP_IMG_RATIO_COOKIE'])
    && is_numeric($_COOKIE['RESP_IMG_RATIO_COOKIE'])
    )
  {
    $ratio = $_COOKIE['RESP_IMG_RATIO_COOKIE'];
Cyclodex’s picture

hmm I think you are doing it wrong, like this you just use the 'RESP_IMG_RATIO_COOKIE' as a string, but it should be the defined CONSTANT, which should have the value of respimg_ratio

It looks more as the first lines are not correct, just because the constant RESP_IMG_COOKIE is defined does not mean the RESP_IMG_RATIO_COOKIE is defined too. (At least it looks like)
So defining it something like that, seems to work for me:

if (!defined('RESP_IMG_COOKIE')) {
  define('RESP_IMG_COOKIE', 'respimg');
}
if (!defined('RESP_IMG_RATIO_COOKIE')) {
  define('RESP_IMG_RATIO_COOKIE', 'respimg_ratio');
}

The newer branch seems to do this differently, at least I could not find this constant defining the same cookie name. Its implemented differently there

ashhishhh’s picture

Hi There,
For me this notice pops up when I enable drupal cache.

#5 has fixed this for me.
Thanks,
Ashish