Hi,

I've just updated my flag module to 6.x-2.x-dev and receiving the following errors on all page views in log entries. I cannot downgrade to flag 6.x-1.2

array_intersect() [<a href='function.array-intersect'>function.array-intersect</a>]: Argument #1 is not an array in /home/mysite/public_html/sites/all/modules/flag/flag.inc on line 407.

Would most appreciate a response on what the problem might be :)

Thank you for this wonderful module.
Lilian

Comments

liliplanet’s picture

Status: Active » Fixed

I deleted flag.tpl.php in my theme folder and all is good :)

timcosgrove’s picture

Status: Fixed » Active

I have this same issue. Deleting flag.tpl.php does not cause the error to stop, and furthermore prevents flags from being printed to page, and causes more errors to be thrown.

timcosgrove’s picture

Apologies: problem was due to us defining flags via install profile and not setting roles in our definition.

Liliplanet, I could be wrong but i'm pretty sure that if you deleted flag.tpl.php and you're not theming elsewhere you have rendered the flag module useless to you, and you should probably just turn it off.

Status: Active » Closed (fixed)

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

mvidelgauz’s picture

Status: Closed (fixed) » Active

I now have the same issue. It has been working for me some time ago but just today I discovered that I cannot set any flag. No records added to flag_content table. Error log shows the same message as mentioned in this issue and also another one:

Unknown column 'sid' in 'where clause' query: SELECT * FROM drupal_flag_content WHERE content_type = 'node' AND content_id = 67581 AND (uid = 1 OR uid = 0) AND sid = 0 in sites/all/modules/flag/flag.module on line 1479

mvidelgauz’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta2

Forgot to mention that I have 6.x-2.0-beta2

quicksketch’s picture

Category: bug » support
Status: Active » Fixed

Unknown column 'sid' in 'where clause' query: SELECT * FROM drupal_flag_content WHERE content_type = 'node' AND content_id = 67581 AND (uid = 1 OR uid = 0) AND sid = 0 in sites/all/modules/flag/flag.module on line 1479

If there is no "sid" column, your database is out of date or incorrect. Try running update.php. If that fails, disable and uninstall the module, then enable it again. I'm marking this issue as fixed, please reopen if you have further questions.

Status: Fixed » Closed (fixed)

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

skepich’s picture

Status: Needs work » Closed (fixed)

repeated message. (del)

skepich’s picture

Status: Closed (fixed) » Needs work

May be this code help you.

function user_access($action = 'flag', $account = NULL) {
    if (!isset($account)) {
      $account = $GLOBALS['user'];
    }

    if ($account->uid == 0 && !module_exists('session_api')) {
      return FALSE;
    }

    //$matched_roles = array_intersect($this->roles, array_keys($account->roles));
    $matched_roles = 1;
    return !empty($matched_roles) || (!$account->uid == 0 && empty($this->roles[$action])) || $account->uid == 1;
  }
joachim’s picture

Status: Closed (fixed) » Fixed

Original issue seems to be resolved. Please open new issues for new problems.

Status: Fixed » Closed (fixed)

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