Hi,

I am the co-maintainer of Drigg, another Drupal project ( http://drupal.org/project/drigg ).

We are having some problems with CCK, and are going *insane* trying to fix them. We have been trying and trying, but at this point those bugs havee been opened for months and they are stalling the project -- and affecting our users.

I was hoping some of you could please help. I am asking this in the most humble way, knowing that you are probably busy enough with your projects.

Here are the bugs:

http://drupal.org/node/264866
http://drupal.org/node/233996

I am 98% suree they are caused by the same problem. The end result, is that Drigg users can't use CCK which is absurd. Please rest assured that I realise that it's MY fault: there is some bug somewhere and I am unable to find it.

However, please have a look at Drigg. You can just download a pre-coocked version, drigg-distr.tgz, here: http://www.drigg-code.org . Then, please try and install CCK and the image module, and... if you find out what the problem is, PLEASE let me know.

If you need a bounty for this, please let me know - I will pay with my own money, because these bugs really need fixing.

Thank you for your time!

Merc.

Comments

karens’s picture

Drigg is a *huge* module, it would take a while to dig around and figure this out :(

Just quickly glancing at your issues, it looks like the problems are modules that do extra processing, like date and imagefield. A couple quick ideas to try out -- are you using drupal_execute() or drupal_save() anywhere. If you use drupal_save(), you can try doing drupal_submit() first to make sure pre- and post-processing gets done. If you're using drupal_execute() more than once in the same session, there is a core bug #260934: Static caching: when drupal_execute()ing multiple forms with same $form_id in a page request, only the first one is validated that might be the problem.

mercmobily’s picture

Hi,

Gosh, I realised that I asked for a lot. Drigg is indeed a huge module. My goodness, the last thing I wanted to be was the author of a huge module!

Drigg does implement the hook hook_insert and hook_update. And they both call votingapi_set_vote -- but that one doesn't call any "execute" either.

I am willing to put my own money to get it fixed. How much would you like to look into this?

Thanks,

Merc.

karens’s picture

Unfortunately, I don't really have time. Maybe someone else does.

dopry’s picture

Unfortunately I don't have time either... CCK operates through nodeapi with Drupal 5.x so it should work with any node... If it's not working for you.. maybe you're stomping on the stuff added by CCK somewhere... You're probably going to have to debug this one on your own as it is a Drigg issue... You wrote the module so you should know better what it does than any of the CCK devs...

@yched: you got time to look at it? If not can we close?

yched’s picture

Status: Active » Closed (won't fix)

No time either, truly sorry :-(.
If you can narrow it to a better identified part of the code, it would be easier to help.

mercmobily’s picture

Status: Closed (won't fix) » Active

Hi,

I set this as "active" so that you'd notice it -- feel free to remark it as closed/won't fix.

We managed to find the part of code that was causing problems. It's simply absurd, however.

Basically, CCK will give the most absurd problems (mainly deriving from fields simply "not sticking") if a VotingAPI vote is cast automatically upon submission. Here, "upon submission" means that drigg implements hook_insert (obviously) and within hook_insert it calls votingapi_set_vote().

In the end, I simply added a flag so that if people use CCK, well, the first vote isn't awarded automatically.

So, it looks l ike Drigg was caught in the crossfire between CCK and VotingAPI. Talk about bugs that are hard to pinpoint!!!

So, my last question is: are you aware of any other problems you've ever had with VotingAPI?

A possible solution is to assign the first vote through a hook_nodeapi() call. However, since votingAPI was basically rewritten, and since we are about to port to D6, this problem might simply "go away".

Bye!

Merc

yched’s picture

votingapi_set_vote() calls votingapi_add_vote(). I don't see anything in the code of these functions that might mess with CCK saving - except that votingapi_add_vote() triggers votingapi_invoke('insert'), and then it again depends on what the other modules do :-(...

yched’s picture

Actually, votingapi_set_vote() also calls votingapi_recalculate_results(), which in turn triggers a bunch of calls to various votingapi_invoke() ops...
You probably need to search the drigg distro for modules that implement hook_votingapi().
You might also try to temporarily comment out the call to votingapi_recalculate_results(), and see if the bug disappears..

mercmobily’s picture

Hi,

kiljoy, could the answer be in one of the invoked modules? What happens if the votingapi is set, but the invoke() for the recalculation is disabled?

Merc.

dopry’s picture

Project: Content Construction Kit (CCK) » Drigg
Component: General » Code

in your own issue queue. I don't know that we can help you further with your votingapi issues...

sikjoy’s picture

Who's kiljoy? ;oP

There are two Drigg modules, according to egrep, that implement Votingapi hooks: drigg_promote and drigg_autovote. They both implement hook_votingapi_insert() and hook_votingapi_update(). Just looking at the code, nothing stands out as being suspicious.

Furthermore, My Drigg devel site did not have the drigg_autovote module enabled while I this bug was occurring.

--sicjoy

mercmobily’s picture

Status: Active » Fixed

Hi,

Sicjoy (sorry about the kiljoy :-D ), what we know for sure is that if a vote is cast when the scoop is added, something goes bananas.

I personally don't think this is fixable. VotingAPI has been *rewritten* (which will make porting to D6 fun). Drupal 6 is also majorly different. This bug is likely to just disappear.

I don't want to see this anymore, nor investigate it. I am closing this. Once Drigg is ported to D6, we'll deal with it if it's still there (along with a zillion issues which will surely pop up).

Closed.

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)