Error when blocking and unblocking a leech source

patchak - May 20, 2007 - 02:43
Project:Content Blocker
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:nedjo
Status:closed
Description

Hi,

When I block a leech source all is ok and the texte on the teaser switches to "unblock this source"... If I click on unblock this source right away, the ajax starts, but the text does not switch back to the original state.

Also on the next page view I get :

user warning: Duplicate entry '1-0-leech_news_feed' for key 1 query: INSERT INTO contentblocker (uid, type, id) VALUES (1, 'leech_news_feed', 0) in /var/www/html/geekfr/includes/database.mysql.inc on line 172.

The link is changed back to the original state on a refresh, but with this error...

Also, each time I block or unblock I get these taxonomy erros, not sure if it's related...

# warning: Illegal offset type in isset or empty in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.
# warning: Illegal offset type in isset or empty in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.

Thanks

Patchak

#1

nedjo - May 20, 2007 - 03:21

Hmm, not sure what's going wrong. Here's a patch to prevent the insert error. But likely it doesn't address the root cause of the bug. Please test however and report back.

AttachmentSize
contentblocker-save-block.patch 1.72 KB

#2

patchak - June 1, 2007 - 16:08

Hi Nedjo,
I just applied the patch and reuploaded the newly patched module, and the error is still there.

When I try to block a source, it works. But when unblocking it seems to work but the linnk stays to "Unblock source".

When I refresh the link is back to normal, but I get these errors,

* user warning: Duplicate entry '1-0-leech_news_feed' for key 1 query: INSERT INTO contentblocker (uid, type, id) VALUES (1, 'leech_news_feed', 0) in /var/www/html/geekfr/includes/database.mysql.inc on line 172.
* user warning: Duplicate entry '1-0-leech_news_feed' for key 1 query: INSERT INTO contentblocker (uid, type, id) VALUES (1, 'leech_news_feed', 0) in /var/www/html/geekfr/includes/database.mysql.inc on line 172.
* user warning: Duplicate entry '1-0-leech_news_feed' for key 1 query: INSERT INTO contentblocker (uid, type, id) VALUES (1, 'leech_news_feed', 0) in /var/www/html/geekfr/includes/database.mysql.inc on line 172.

SO it seems the patch did not change anything to the behaviour. The taxonomy errors are not there, tho.

Thanks,
Alex

#3

patchak - June 4, 2007 - 18:19

Any ideas about how to follow up this issue?
Thanks

#4

patchak - June 6, 2007 - 14:38

Please not that the Leech source blocking really does not work on my site. When I try to block a source I see the status changing on the link, but when I refresh, the content is still there, I get this error:

user warning: Duplicate entry '1-0-leech_news_feed' for key 1 query: INSERT INTO contentblocker (uid, type, id) VALUES (1, 'leech_news_feed', 0) in /var/www/html/geekfr/includes/database.mysql.inc on line 172.

and the link is back to the original 'block source' state, like nothing happenned.

Please, please help me tackle this issue as now the whole concept of blocking leech sources is broken!

Thanks,
Patchak

#5

nedjo - June 6, 2007 - 14:40
Assigned to:Anonymous» nedjo

The issue looks to be the 0 in the insert. An id is being lost. I'll have a look. I don't have a current testing install, but will try to set one up.

#6

patchak - June 6, 2007 - 14:41
Assigned to:nedjo» Anonymous

After further experiments, it seems that when you block a source directly from the "source" node (and not from an item) the content gets actually blocked....

Although on the next page refresh, you'll get this error :

* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.

It seems that it really does not work when the source is blocked directly from a source item...

#7

nedjo - June 6, 2007 - 21:12
Assigned to:Anonymous» nedjo

Found and fixed a couple of mistakes in the logic of determining what is being blocked/unblocked when clicking on a leech source item's link. Appears to be working now. Please confirm and, if so, mark this fixed.

#8

patchak - June 7, 2007 - 08:24

Hi Nedjo:

I'm using this version now :

$Id: contentblocker.module,v 1.1.2.5 2007/06/06 21:10:14 nedjo Exp $

Bad news, nothing is fixed, it seems to be worst since I cannot block a Source feed even from the source page...

Here is the error when I try to block a Source Feed and then refresh on another page to check if the blocking worked:

* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= n.nid WHERE n.nid = 797' at line 1 query: SELECT lnf.nid FROM leech_news_feed lnf INNER JOIN node n ON lnf. = n.nid WHERE n.nid = 797 in /var/www/html/geekfr/includes/database.mysql.inc on line 172.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
* warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.

The link is still marked as "block this source", like nothing hapenned...

When I try to block a source directly from the item, the link changes status, but on refresh I get this:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= n.nid WHERE n.nid = 807' at line 1 query: SELECT lni.fid FROM leech_news_item lni INNER JOIN node n ON lni. = n.nid WHERE n.nid = 807 in /var/www/html/geekfr/includes/database.mysql.inc on line 172.

the content is still there, and the link is back to "block this source"...

Am I playing with the right version of the module? I just grabbed it from cvs...When I downloaded from CVS I got the 1.1.2.2 version which was marked something around in April...

Thanks,
Patchak

#9

nedjo - June 7, 2007 - 14:33

The module works on my testing.

Please ensure you have replaced all files in the distribution. The error seems to suggest that you have an old version of leech.inc.

I'm kind of assume the taxonomy errors come from a different module, unless there is some specific reason to associate them with contentblocker, as contentblocker does nothing with taxonomy. Likely they are triggered by a module error on node_save(), which is called by contentblocker. I don't get these errors (and didn't either before the last patch).

#10

patchak - June 7, 2007 - 21:29

Hey Nedjo,

For testing purposes I disabled two taxonomy related modules:

1) community tags
2) Taxonomy Batch Operations...

Even after disabling both modules I still have the same error..

# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1150.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1151.
# warning: Illegal offset type in /var/www/html/geekfr/modules/taxonomy/taxonomy.module on line 1154

I know it may sound silly but have you tried testing the module with taxonomy module enabled and with nodes tagged?

My next step is to setup a test site with only leech and content blocker so that I can add the modules one at a time and see when the error comes...

Please let me know the results of your experments with taxonomy module!

Patchak...

#11

nedjo - June 7, 2007 - 21:49
Status:active» fixed

Yes, I have tested.

This issue appears to be fixed.

#12

patchak - June 8, 2007 - 13:40

Well the man issue is fixed! Thanks!

Turns out the other errors were coming from pathauto but this has been fixed as well, sweet!

Patchak

#13

Anonymous - June 22, 2007 - 13:54
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.