Hello,

I have a fresh install & it gives me a notice when I activated the block - My visitors history adv.

Which is - Notice: Undefined index: total in user_visits_adv_get() (line 175 of /var/www/dsn/sites/all/modules/user_visits_adv/user_visits_adv.module).

Thanks,
RajeevK

Comments

francoud’s picture

Subscribe.

javier.drupal.2012’s picture

Subscribe

Herndl’s picture

Subscribe

quixxel’s picture

Notice: Undefined index: visitors in user_visits_adv_get() (line 175 of /var/www/dsn/sites/all/modules/user_visits_adv/user_visits_adv.module).
Notice: Undefined index: total in user_visits_adv_get() (line 175 of /var/www/dsn/sites/all/modules/user_visits_adv/user_visits_adv.module).
Notice: Undefined index: history in user_visits_adv_get() (line 175 of /var/www/dsn/sites/all/modules/user_visits_adv/user_visits_adv.module).

togbonna’s picture

Because you just installed the module, no data has been recorded for your profile on the User Visits Advanced table hence the notice. This array structure: $user_visits_adv_data is not initialized for first use.

My solution: Add the following after line 172 of the user_visits_adv.module file and the notice goes away:

$user_visits_adv_data[$uid]['total'] = 0;
$user_visits_adv_data[$uid]['visitors'] = 0;
$user_visits_adv_data[$uid]['history'] = 0;

Now, whether this is the best solution, I can't say, but it solves the problem.

amitgoyal’s picture

Status: Active » Fixed

Thanks for pointing this out and providing the solution.

This has been fixed in development branch 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

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