Needs review
Project:
OpenSocial Shindig-Integrator
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2010 at 07:02 UTC
Updated:
28 Jan 2010 at 09:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
pbuyle commentedThis second patch uses drupal_bootstrap to fully initialize, including all enabled modules. It then use it to offers Drupal Hooks to alter results of get methods. It also offers Hooks for data insertion methods. For these, the shindig_integrator DB is used as fallback if no hooks returned a true value.
An example use case for the results alteration is to allow a module to provides custom logic for thumbnail image. While the patch in #685182: support for user_picture_default for THUMBNAIL_URL is fine for basic use case, the site administrator may want to use ImageCache to resize, crop, add watermark to, etc. user picture when used in an opensocial gadget.
Another use case is the Address fields of the person. The patch in #673756: support for opensocial.Address field in ShindigIntegratorDbFetcher::getPeople rely on tow additional Profile fields. With this patch, hooks could be provided to set user addresses using the different existing addresses solutions (eg. Location, Postal + a href="http://drupal.org/project/content_profile">Content Profile, Addresses, etc.).
And finally, the insertion hooks could be used in addition to the alter hook to provides access to third party modules as AppData or activities (eg. store AppData in a Content Profile node).
Comment #2
pbuyle commentedIn the patch, the loop to set $this->drupal_dir doesn't work if the module realpath is not in under the Drupal dir. This is the case, for instance, when Drupal is installed with Debian package. Drupal dir is /usr/share/drupal6 but /usr/share/drupal6/sites is a symlink to /etc/drupal/6/sites. So the loop doesn't work. Ends up in '/' and rhe require_once throws a fatal error.
To fix this, the drupal_dir can be set in the generated local.php and retrieved in ShindigIntegratorDbFetcher. The
The attached patch provides this fix. It also fix all db_query calls to use {} around table name.