i realize that boost support comment
how to make it support voteAPI or fivestar

Comments

mikeytown2’s picture

Version: 6.x-1.0-rc5 » 6.x-1.x-dev
Category: support » feature
mikeytown2’s picture

Title: voteAPI:fivestar: » Flush cache: Voting API and Fivestar
dbeall’s picture

I don't know how to find out about hooks and what modules use them, the project pages do not specify..I am such a noob.
I use event, weblinks, forum, Edit(guestbook) they are submitted by anonymous and authenticated users.

Edit again, poll.. this list could go on and on.

mikeytown2’s picture

Hooks are somewhat hidden; found them in the api.txt doc

http://api.lullabot.com/votingapi_add_votes
hook_votingapi_insert()

http://api.lullabot.com/votingapi_delete_votes
hook_votingapi_delete()

Also found this code in the abandoned cachestatic module; which was a fork of boost.

	/**
	 * Function de suppression de page en cache en cas de vote !
	 * Hook_votingapi_insert()
	 * @param $votes
	 * @return unknown_type
	 */
	function cacheStatic_votingapi_insert( $votes ) {
		foreach( $votes as $vote ) {
			$nodeLoaded 	= node_load($vote['content_id']);
			$path 				= $_SERVER['HTTP_HOST'].'/'.$nodeLoaded->path.'.html';
			cachestatic_removeCacheForThisPage( $path );
		}
	}
mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new3.4 KB
dbeall’s picture

I may be missing something..
My test pages http://www.davebeall.com/node-gallery
Galleries have 5star voting on photos

added patch
uninstall boost, re-install boost with patches, run cron, preemptive cache primed as normal.

goto: photo page, enter vote, takes vote,
navigate away from page, clear browser cache,
go back to page where i voted,
vote not recorded.

advise as how to test...

dbeall’s picture

Status: Needs work » Needs review

add note: anonymous vote, login, clear cache with admin menu, log out, shows vote

Scratch that, not keeping vote..

mikeytown2’s picture

Status: Needs review » Needs work

Looks like I need to install this module on my test setup; was hoping the cache static author knew what he was doing. Marking this needs works since it seems to not work as one would hope.

dbeall’s picture

Status: Needs review » Needs work

you want in my site?

mikeytown2’s picture

na, I'll bug you if I do need it though.

mikeytown2’s picture

StatusFileSize
new3.35 KB

yeah, reason it didn't work was I forgot to change the function name... dumb. Anyway test this out.

mikeytown2’s picture

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

added to the boost_has_site_changed() function as well

dbeall’s picture

works like a champ ! takes anonymous vote, clears cached page, rebuilds page. revisit page, vote is there.
I am using the rules cron trigger

for the record used the .1 patch

dbeall’s picture

Status: Needs review » Reviewed & tested by the community
mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

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