On upgrade of apachesolr modules to beta7

[Fri Apr 10 21:11:34 2009] [error] [client 127.0.0.1] PHP Fatal error:  Unsupported operand types in /var/www/versions/blocks/modules/apachesolr/contrib/apachesolr_og/apachesolr_og.module on line 101

Patch adds isset to check that the facet was enabled.

Note, the scenario to produce this error is not likely unless the previous apachesolr_og patch was installed, the user enabled the facet block, upgraded to a solr version that now included 'enabled-filters' such as beta7, and went to the admin blocks page.

Comments

pwolanin’s picture

Ok, we should also update this module to use the negative query functionality for nodes not in any group ASAP.

See the code I added for book module integration.

pwolanin’s picture

Title: array check in apache solr og block » apache solr og update for negative facets, minor fixes, install/enable/update hooks.
Status: Active » Needs review
StatusFileSize
new3.75 KB

cleanup patch incorporating the one above.

pwolanin’s picture

Status: Needs review » Needs work

I think the query in the update function is wrong - will only update groups, not nodes *in* groups.

aufumy’s picture

Status: Needs work » Needs review
StatusFileSize
new3.86 KB

Added update to og_ancestry for nodes in groups

pwolanin’s picture

oddly, OG doesn't consider group nodes themselves to be in in a groups, at least not looking at the og_nodeapi code from 6.x-1.3. Will have to ask Moshe about that.

Should there be a different facet for nodes that are groups? Should we try to index the, as if they were in the group corresponding to their own nid?

aufumy’s picture

Good point. That makes sense to me.

pwolanin’s picture

Moshe says that a group node should not appear within the facet list for that groups (but that some might feel otherwise). Let's get the basic fix in here (which means removing the query against {og}) but maye you can roll a patch to add a configurable option to also index groups nodes with their own nid as gid?

aufumy’s picture

StatusFileSize
new5.12 KB

Added checkbox to apachesolr og admin section, and if checked than index group nodes within that group.

Just rolled it, will check code tomorrow.

aufumy’s picture

StatusFileSize
new5.16 KB

Tested this patch, when admin checkbox for indexing group nodes within their group, facet block includes their count.

pwolanin’s picture

should the admin page be under admin/og? That might make more sense?

pwolanin’s picture

Status: Needs review » Fixed
StatusFileSize
new6.38 KB

we don't want or need a separate perm. Also, need to mark group nodes for re-indexing.

committing this to 6.x

pwolanin’s picture

Status: Fixed » Closed (fixed)