The text displayed in the 'more' link options can drive newcomers to confusion. It says:

Do not display more link unless there is more content .

This will display the more link even if there are no more items to display.

Which is obviously contradictory and may lead to the wrong belief that checking the option will make the 'more' item to appear always.

Comments

slv_’s picture

StatusFileSize
new904 bytes

I attach a patch to display a more appropiate text:

Display 'more' link only if there is more content
Leave this unchecked to display the 'more' link even if there are no more items to display.

dawehner’s picture

Status: Needs review » Needs work
+++ b/plugins/views_plugin_display.incundefined
@@ -1389,8 +1389,8 @@ class views_plugin_display extends views_plugin {
+          '#title' => t("Display 'more' link only if there is more content"),

Well it's actually not that way. If you check use_more_always there is no check for more items, the link just appears. Your description would be right, if the option would be negated

Did this helped you? Thanks for working on better help texts!

slv_’s picture

Status: Needs work » Needs review

Well, it turns out that this specific option is actually negated, so that's why this is working like that. (the line #default_value is on the attached patch itself, so can be checked there too).

Double checked and tested, and checking the option is definitely not showing the link if there are no more items.

The funny thing is that I didn't realize the option was negated until I re-opened the code, and then saw your reply!.

Hope this clarifies all and the patch is useful. Changing to needs review again.

Thanks for your quick reply dereine.

Cheers! =)

dawehner’s picture

Are you really sure?

2427     if ($this->use_more() && ($this->use_more_always() || (!empty($this->view->query->pager) && $this->view->query->pager->has_more_records()))) {
  function use_more_always() {
    if (!empty($this->definition['use more'])) {
      return $this->get_option('use_more_always');
    }
    return FALSE;
  }
slv_’s picture

Absolutely sure (the line numbers may differ slightly, but this 2 snippets are from the pop-up form and from the options_submit(&$form, &$form_state) function:

1390        $form['use_more_always'] = array(
          '#type' => 'checkbox',
          '#title' => t('Do not display more link unless there is more content'),
          '#description' => t("This will display the more link even if there are no more items to display."),
          '#default_value' => !$this->get_option('use_more_always'),
            '#dependency' => array(
              'edit-use-more' => array(TRUE),
            ),
        );

Note the "!" mark in "#default_value" line when retrieving the value

2232      case 'use_more':
        $this->set_option($section, intval($form_state['values'][$section]));
        $this->set_option('use_more_always', !intval($form_state['values']['use_more_always']));
        $this->set_option('use_more_text', $form_state['values']['use_more_text']);

And the same "!" here when storing the value.

So, when you actually *check* the option, the stored value is 0, instead of 1, and that's why checking the option, doesn't render the link.

Don't know why that was set that way, and if may affect to other functions, but it seems clear to me that the UI text is misleading for the end user, the way this works right now

Cheers.

slv_’s picture

Any word on the last comment?

Cheers...

and merry xmas, btw! =)

westbywest’s picture

I confirm this problem exists with my setup too:

Drupal 7.12
Views 7.x-3.1
Features 7.x-1.0-beta6 (since problem was found debugging features/views issue)

The text next to the checkbox "This will display the more link even if there are no more items to display" does appear to directly contradict what that checkbox does.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Oh this issue got somehow lossed, sorry for that.

You are right, i remember, the logic was reversed.

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed now to 7.x-3.x, let's see maybe someone wants to backport that to 6.x-3.x

slv_’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new904 bytes

I attach the backported patch for 6.x-3.x.

Not sure if that's correct, but I'm changing the status to needs review.

Btw, thanks for coming back to this dawehner =).

Cheers guys.

dawehner’s picture

Status: Needs review » Fixed

Thanks for the rerole! Committed it to 6.x-3.x as well

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