Projects:
If projact maked by my all is ok, if project maked by another person and acess for me assigned i saw:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ('storm_access'='storm_access') AND ( n.status = 1 AND sex.project_nid = 1' at line 1 query: SELECT DISTINCT sex.*, n.title FROM stormexpense sex LEFT JOIN node n USING(nid) INNER JOIN node_access na ON na.nid = sex.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1189 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 4 AND na.realm = 'content_access_rid') OR (na.gid = 6 AND na.realm = 'content_access_rid'))) AND ( (n.uid=1189 OR sex.organization_nid=) AND ('storm_access'='storm_access') AND ( n.status = 1 AND sex.project_nid = 1206 ) ) in /var/www/miuz/data/www/miuz.org/sites/all/modules/storm_contrib/stormexpense_extension/stormexpense_extension.module on line 274.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ('storm_access'='storm_access') AND ( n.status = 1 AND sin.project_nid = 1' at line 1 query: SELECT DISTINCT sin.*, n.title FROM storminvoice sin LEFT JOIN node n USING(nid) INNER JOIN node_access na ON na.nid = sin.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1189 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 4 AND na.realm = 'content_access_rid') OR (na.gid = 6 AND na.realm = 'content_access_rid'))) AND ( (n.uid=1189 OR sin.organization_nid=) AND ('storm_access'='storm_access') AND ( n.status = 1 AND sin.project_nid = 1206 ) ) in /var/www/miuz/data/www/miuz.org/sites/all/modules/storm_contrib/storminvoice_extension/storminvoice_extension.module on line 244.

Comments

kfritsche’s picture

Title: new error » Storm Invoice/Expense access SQL rewrite error
Project: Storm Contrib » Storm
Version: 6.x-1.x-dev » 6.x-2.x-dev
Component: Code » Storm Invoice
Category: support » bug

I looked into it, i think there is maybe something wrong with storm.

Thew storm_contrib function calls storminvoice_access_sql().

  if (user_access('Storm invoice: view of user organization')) {
    if (!empty($cond)) $cond .= ' OR ';
    $cond .= 'sin.organization_nid='. $user->stormorganization_nid;
  }

Could it be, that $user->stormorganization_nid is empty? I think we should add a check here, if this is set and not empty. Something like:

  if (!empty($user->stormorganization_nid) && user_access('Storm invoice: view of user organization')) {
    if (!empty($cond)) $cond .= ' OR ';
    $cond .= 'sin.organization_nid='. $user->stormorganization_nid;
  }

@X3mStorm: Have you stormperson disabled or is your account not assigned to an stormperson?

X3mStorm’s picture

Component: Storm Invoice » Storm.module
Category: bug » support

stormperson is enabled
all users at team have "access denied" for tasks and projects for and this errors, but in settings they have access
user have access for project just if he made this project

kfritsche’s picture

Are the users, which try to access the project assigned to a stormperson?
Have the stormperson a assigned organization?

X3mStorm’s picture

where i can see it?

X3mStorm’s picture

i found
Are the users, which try to access the project assigned to a stormperson?
Yes
Have the stormperson a assigned organization?
Yes

X3mStorm’s picture

still not working, where I need to look?

kfritsche’s picture

Hard to tell.
Have you tried to turn of the Permissions: "Storm invoice: view of user organization" and "Storm expense: view of user organization".
Which storm project and storm project extension permissions are set for the users, who can't access the project you created? Any special settings made on the project? Have you installed any access rewrite module?

juliangb’s picture

Category: support » bug
Status: Active » Postponed (maintainer needs more info)

A bit of filing - this is a potential bug report, but we need more info to be able to determine whether it can be reproduced.

juliangb’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen if more information can be supplied.