Views does not hide hidden or flagged nodes

misty3 - February 8, 2009 - 12:11
Project:abuse
Version:6.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:BTMash
Status:active
Description

The default blog page hides a flagged blog node, flagged or hidden by Abuse
however if a views listing is used it still shows up the hidden blog node.

This same problem described here also - http://drupal.org/node/315404
That is exactly wht is happenning even with all the latest recommended versions
of abuse and views.

How does the default blog page of drupal builds up the query tp present a list of blogs / blog teasers ?
How Views differ from it so that it continues to list hidden items ?

If a comment is hidden or removed by abuse , Views still shows the same comment count, ideally when the comment count should have been reduced by minus one as the viewer cannot see the comment.

#1

merlinofchaos - February 8, 2009 - 18:10
Project:Views» abuse
Version:6.x-2.3» 6.x-1.x-dev
Component:Views Data» Miscellaneous

Views just shows the data that's there. If abuse is wanting to hide things, then it has to change the data. I suspect abuse is actually taking over core pages, showing different information, rather than changing the data.

It is not Views responsibility to understand this stuff, it's abuse's responsibility to tell Views.

#2

misty3 - February 8, 2009 - 22:15

I see. It bugs me however that the default or out-of-box core blog module of drupal understands 'abuse' and when it displays the list of blogs or blog teasers with titles there is mutual respect, that is, inbuilt views of blog does understands 'abuse'

So I was wondering how Views differently views than the core view that is already there.
At some time in past I think there was discussion of doing away with core blog or core forum and keeping only Views for this. One big disadvantage of that will be dealing with such issues.

#3

dman - February 8, 2009 - 22:42

FYI

<?php
function _abuse_remove($type, $oid) {
 
db_query("UPDATE {abuse} SET valid=1 WHERE type='%s' AND oid=%d", $type, $oid);
  switch (
$type) {
    case
'node':
     
db_query("UPDATE {node} SET status=-1 WHERE nid=%d", $oid);
...
?>

abuse.module (quite rightly) just flags an items status, nothing mysterious and internal.
A view should simply be configured to not show unpublished items as normally required and life should carry on as normal.
So following the normal views installation/configuration instruction should get you to a working result.

... or did you just not configure the view right?

#4

misty3 - February 9, 2009 - 03:08

The problem is Abuse does not unpublish a node itself. Proof is that the node can be still visited by direct link. While unpublished node cannot be.

The default "views" that come with blog has no problem : it simply does not "see" or does not list the flagged or hidden items in the list. However apparently Views "view" things differently.

You may ask why not use then the default or core blog only ? Problem is that it cannot be configured as I wish - this flexibility is given by Views.

However Views obviously does not respect "Abuse" like core blog - so I asked what is the differnence between the way things are viewed by core drupal and Views ?

I do not know if the previous versions worked correctly but the latest recommended versions are not.You can do a test install of the latest versions and see for yourself. If I have not configured views correctly it will be nice if any coder has time to spare and post a correct "import" here.

#5

dman - February 9, 2009 - 03:25

Looks to me like - as in the code posted above - abuse is doing something odd with the status.
'unpublished' is status=0
Views and core and the rest expect status to be 0 or 1 AFAIK
abuse.module sets it to -1

It's possible that logic in one place, or at one time in one version said: "if status != 1 then hide" which is different from "if status == 0"
I dunno, but it looks like abuse.module is confusing the field.
Views may not be able to understand what -1 means in this context. Probably due to a slightly different SQL query.

The problem is Abuse does not unpublish a node itself. Proof is that the node can be still visited by direct link. While unpublished node cannot be.

is this desired or intentional behaviour? or an accidental quirk?

#6

BTMash - February 9, 2009 - 03:56

I've been busy with a bunch of different things which is why I haven't had a chance to see what is happening with the abuse issues.

This one is definetly a duplicate issue of another where ppl have said content is still shown despite hiding a particular content. Now I can understand that it is when using with views.

My reasoning for using the different status has been due to a use case I had with the client that this module was designed for - users with still unpublished content can view their pending content but cannot view content that was 'removed' by a moderator. Hence 1 = published, 0 = hidden/pending, -1 = removed.

Perhaps I need to get a better understanding of node_access or sql_rewrite as that could help with the rewrite so this module plays along more nicely with views.

#7

BTMash - February 9, 2009 - 03:59
Priority:normal» critical
Assigned to:Anonymous» BTMash

Considering how important views is, figuring this out (hopefully with the help of others) is very important to me as well.

#8

misty3 - February 9, 2009 - 09:12

HiBTMash

Thanks for the help. There was a duplicate in Abuse issues but I dont know whether there was in Views, particularly the latest Views which has now changed a lot. So I posted here also.

As Dman has pointed out how core drupal or core Blog looks at the list is not exactly the same how Views looks at things, so may be we can pinpoint the difference and then proceed ?

While some solution hopefully comes out the only means to get things going is deleting the node that has high abuse report. Thas has to be done by the admin manually.

#9

BTMash - February 10, 2009 - 04:12

Another option (as was pointed out in the other issue queue) is to set pending/hidden/removed to unpublished (status = 0) status - this atleast provides **some** level of a fix.

#10

misty3 - February 10, 2009 - 04:25

This option is really problamtic, because items that are submitted for approval or promotion eg. scoops (as in drigg) and then published are in a separate "not yet published" (upcoming list)

This is not the same as those that are removed due to explicit abuse.

 
 

Drupal is a registered trademark of Dries Buytaert.