If for a group, you set No to "Show %taxonomy_term" then when going to the /weblinks/%tid page, the group stays hidden.

I have modified the weblinks.module (in attachement) to fix it: basically a parameter is added to weblinks_get_tree() to set a flag if we are on the main page or not. This is identified in weblinks_page() by a $tid parameter == 0. The default value of the parameter is TRUE for backward compatibility.

Comments

gstegemann’s picture

Issue summary: View changes

Shall we implement this change?

jonathan1055’s picture

Shame they didn't produce a patch so we could see exactly what was changed. How does this code from four years ago compare to the current .module?

I just tried testing this and on saving after selecting 'no' I got:

Undefined index: confirm_delete in weblinks_blocks_form_alter()
(line 897 of /Library/WebServer/Documents/drupal6/sites/all/modules/weblinks/contribs/weblinks_blocks/weblinks_blocks.module). 

So I guess that's another one to fix before we continue.

gstegemann’s picture

Yes, but the changes are minimal and straight forward:

function weblinks_get_tree($parent = 0, $quick = FALSE, $ismainlinkspage = TRUE) {

Third parameter $ismainlinkspage added.

    if (!$admin && ($term->depth > $max_depth || ( $ismainlinkspage && !$show_this_term) )) {
      continue;

Checking parameter $ismainlinkspage, if set skipping the term when it should not be displayed.

  $tree = weblinks_get_tree($tid,FALSE, $tid == 0 );

In function weblinks_page in call to weblinks_get_tree assignment for third parameter added.

I tested hiding a group as well (w/o the above changes), and it works as designed. I could save the changed setting w/o any PHP errors.

Most probably you hit the 'Delete' button which is located left from the 'Save' button. And second when I clicked the 'Delete' button a confirmation dialog was displayed, as expected.

jonathan1055’s picture

Version: 6.x-2.3 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.04 KB

No, I definitely get that error when editing a group on 'save', not 'delete'. I've raised a separate issue to deal with any of these #2383879: PHP5 warnings in 6.x - Undefined index, undefined variable, undefined property

Going back to the original problem, I can see that hiding the group from the main page is a useful feature, as you may want to only have the links displayed in a block. But the designer may also want to provide access to the links for this term from other places, so having the page show empty is no use. I think this is a bug, and should be fixed, and I like the way mdoubez did it.

Here is a first-draft patch for the changes as above. Fixing D7 first.

gstegemann’s picture

hm..., I have never seen that error.

But I agree, the change makes sense and your patch looks OK. I can test it the overnext week.

gstegemann’s picture

Status: Needs review » Reviewed & tested by the community

Tested. Patch works for me.

  • jonathan1055 committed 7424737 on 7.x-1.x authored by mdoubez
    Issue #1010674 by jonathan1055: For hidden groups, do not hide on...
jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to Michael for the original code and to Gerhard for testing.

Status: Fixed » Closed (fixed)

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

jonathan1055’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new1.98 KB

This bug was originally raised at 6.x and the correction is identical. I had this change pending in my 6.x local test site, so thought I might as well make a patch before checking out the code for current testing.
Here's a patch

gstegemann’s picture

Status: Needs review » Reviewed & tested by the community

OK. Tested and works.

  • jonathan1055 committed 555af62 on 6.x-2.x
    Issue #1010674 by jonathan1055: D6 When hiding a group on main page, it...
jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Thank you.

Status: Fixed » Closed (fixed)

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

Status: Closed (fixed) » Needs work

The last submitted patch, 10: 1010674_10.do_not_hide_links_on_group_page.d6.patch, failed testing.

jonathan1055’s picture

Status: Needs work » Fixed

The issue is fixed. Old patch from #10 got requeued, and obviously it fails to apply because the code change is already committed in #12.

Status: Fixed » Closed (fixed)

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