User integration bug?
zemQ - April 27, 2009 - 12:07
| Project: | OpenX Manager |
| Version: | 6.x-1.02 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
Description
openx_manager_user($type, &$edit, &$user, $category = NULL) is called for all users. Shouldn't _openx_manager_user_integration($permission, $user) be used here? The openx-api is called each time I create or update a user in Drupal, which means that OpenX-advertiser, -manager and -publisher is created in OpenX.

#1
From my point of view this is the essence of user-integration.
BUT: Unfortunately these automatically created users are created ( in ox_clients the agencyid is always 1 ) in context to the default agency (where ox_agency.agencyid = 1 ), although for all of them a row in the ox_agency has been created.
How it should be: Every integrated user should be associated to its own automatically created agency ( ox_clients.agencyid = ox_agency.agencyid ).
#2
Additional tabs (Advertiser, Manager, OpenX user, Publisher) show on user pages after I installed this module. These tabs were clicked to investigate the options. On first click a CCK error showed for each tab. On second click no error was produced and the user's name showed below the tab. I tried a second user to determine if the CCK error will show again (and it did).
Checking /admin/content/node I saw that new nodes of OpenX types User, Advertiser, Manager, and Publisher were created for the users whose tabs I clicked.
I assume that node creation on viewing/clicking the OpenX tabs of on user pages is not the intended operation, so this is a very critical bug.
The errors produced on first click of the tabs are as follows:
Advertiser:
addAdvertiser: 801: Email is not valid
warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/sites/all/modules/cck/content.module on line 1284.
Manager:
addAgency: 801: Email is not valid
warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/sites/all/modules/cck/content.module on line 1284.
OpenX user:
addUser: 801: Field 'defaultAccountId' in structure does not exists
user warning: Duplicate entry '0' for key 2 query: INSERT INTO openx_manager_user (nid, ouid, contact, email, duid) VALUES (2442, 0, '', '', 14) in /home/xxxx/public_html/xxxx/includes/common.inc on line 3436.
warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/sites/all/modules/cck/content.module on line 1284.
Publisher:
addPublisher: 801: Email is not valid
warning: Invalid argument supplied for foreach() in /home/xxxx/public_html/xxxx/sites/all/modules/cck/content.module on line 1284.
Drupal Version: 6.13
OpenX Server Version: 2.8.1
CCK Version: 6.x-2.4
#3
warning: Invalid argument supplied for foreach() in /home/XXXX/public_html/modules/cck/content.module on line 1284.
I just started a new install of drupal and had no problems until I tried testing it when not logged in. I wanted people to be able to leave comments without logging in. Thats where the problem started.
Even if I gave permission it still would only show that there was another comment = eg 3comments - but you couldnt see them.
Dam - can anyone explain to someone thats not a programmer an easy way to fix this error?
#4
With respect to the "Duplicate Entry" error mentioned above, I made this error go away by changing the DB field open_manager_user.ouid to auto_increment.
I'm attaching a patch for the file open_manager.install. Please review.
People with an existing openx_manager install will need to change this DB field manually via command line tools or phpmyadmin (if you are using MySQL).