Enable the block Top upcoming in current category.
Add some drigg and assign those to subcategory (say drigg A)
Add another drigg and assign to any of the top level category (say drigg B)

Observer on the front page for A and B are shown in the block.

goto appropriate category section
Observe that only items in top category (A) are shown in the block. Anthing in subcatgory is never shown in the block.

Expected behaviour : the block should show everything in the category (including subcategory driggs)

Comments

mercmobily’s picture

Status: Active » Closed (duplicate)

Hi,

Marking this as duplicate of #314647: items in sub-categories not included in category RSS feed -- it _is_ the same issue, right?

Merc.

ajayg’s picture

It is different issue in the sense one affects Rss and another affects block. Could be same issue underlying but perhaps you will need to make changes two placess. It is upto you how you want to manage these two.

mercmobily’s picture

Hi,

OK, linked to this from the other issue. Coolclu3 will have a look.

Merc.

coolclu3’s picture

The other issue is related to *PUBLISHED* items in the subcategories while this one is about *UPCOMING* items...

When I post a scoop, and untick the "Published" option, the scoop does not appear in the "Published". Well, it shouldn't.
But strangely enough, it doesn't appear in the "Upcoming" either. I don't know where it belongs now. I can still access the scoop by going to /node/20, the scoop is there but it's not shown in any queue.... I must have mis-config'ed something....

I haven't needed to use the "Upcoming" queue at all....

ajayg, Merc,
how can i reproduce & see the items Upcoming queue? What am I missing?

mercmobily’s picture

Hi,

I don't suppose I can leave you guys to this?
I am working countless hours, FriendList, Activity Log, and the Drupal Shindig integration. If you could cover this for me, that would be _grand_.

Thanks a lot,

merc.

ajayg’s picture

coolclu3
Aren't the steps I gave at the top of page sufficient in detail to reproduce?

mercmobily’s picture

Hi,

I am 98% sure he's dealing with all of the issues, even these ones.
If that's so, coolclu3, can you please close this one?

Merc.

dejbar’s picture

Status: Closed (duplicate) » Active

I've checked this out and the fixes in #314647: items in sub-categories not included in category RSS feed don't appear to address this. It looks like fixing this issue requires changes to the drigg_blocks module. I've implemented a fix and it is working well on our site. I don't know exactly how to properly prepare a patch so I'll just post the diff here as code in the page.

--- drigg_blocks/drigg_blocks.module.orig       2008-12-07 20:35:55.000000000 -0500
+++ drigg_blocks/drigg_blocks.module.new        2008-12-07 20:35:36.000000000 -0500
@@ -205,7 +205,16 @@
             if($section){
               $extra_join .= ' LEFT JOIN {term_node} t ON n.nid = t.nid ';
               $tid= drigg_is_section_valid( $section );
-              $where_conditions.=" t.tid=$tid AND ";
+             // DB Hack to add extra sub categories
+             $subresult = db_query("SELECT tid, parent from term_hierarchy where parent = $tid");
+              $subs = array();
+              while($subr = db_fetch_object($subresult)) {
+                       array_push($subs, $subr->tid);
+               }
+               array_push($subs, $tid);
+
+                $where_conditions.=" t.tid in (".implode(',', $subs).") AND ";
               $section_name=drigg_section_name_by_safe_name($section);
               $subject=t('Best upcoming scoops - !section_name', array('!section_name' => t($section_name)  ) );
             }
@@ -245,9 +254,20 @@
           $section = drigg_get_section_from_url();

           if($section){
             $extra_join .= ' LEFT JOIN {term_node} t ON n.nid = t.nid ';
             $tid= drigg_is_section_valid( $section );
-            $where_conditions.=" t.tid=$tid AND ";
+           // DB Hack to add extra sub categories
+           $subresult = db_query("SELECT tid, parent from term_hierarchy where parent = $tid");
+           $subs = array();
+           while($subr = db_fetch_object($subresult)) {
+               array_push($subs, $subr->tid);
+           }
+           array_push($subs, $tid);
+
+            $where_conditions.=" t.tid in (".implode(',', $subs).") AND ";
             $section_name=drigg_section_name_by_safe_name($section);
             $subject=t('Best published scoops - !section_name', array('!section_name' => t($section_name)  ) );
           }
ajayg’s picture

@dejbar, I haven't yet tested your code. But looking quickly I see you have introduced an extra query "select tid, parent.....). If you look at #314647: items in sub-categories not included in category RSS feed that solution is trying to just change existing select conditions. The point I am making is what you are trying the achieve with extra query may be already available elsewhere and reusing/remashalling that data may be more efficient.

dejbar’s picture

Hi ajayg,

Good point. If the list of sub categories is already available then using them will surely be more efficient. Also the use of drigg_ui_get_all_offspring_tids($tid) is more general and could allow for caching of the query results at many different levels. At the time I really just needed to fix this quickly so for 30 minutes work that was all I could think of. My knowledge of the database structure is better then my knowledge of drigg's code.

So replacing my changes with

    $tid_list = listize_from_array(drigg_ui_get_all_offspring_tids($tid)); //string
    $tid_list .= $tid;
    $where_conditions .= " t.tid IN ($tid_list) AND ";

would appear to work but I haven't tested this yet.

mercmobily’s picture

Hi,

Can you give it a test and let me know if it's 1000% good for you?

Merc.