I've got a view with two arguments that default to "Summary, sorted descending". When I view it without entering either argument, the list it prints out looks like this (note that there is no content in the links)

<ul>
<li><a href="/journal/issue/"></a> (956)</li>
<li><a href="/journal/issue/1"></a> (18)</li>
<li><a href="/journal/issue/2"></a> (17)</li>
...
<li><a href="/journal/issue/59"></a> (13)</li>
</ul>

In a browser, because there is no content in the links, it just shows up like this:
* (956)
* (18)
* (17)
...
* (13)

The same thing happens, on a smaller scale, when I enter just the first argument.

Possibly related bug filed on the date module:
www.drupal.org/node/148125

Any ideas? Where is the link text supposed to come from? This is my first time using summary views.

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

Where the text comes from is dependent upon the argument you're using, which you neglected to specify.

mr.j’s picture

I have exactly the same problem, and it always seems to be when the argument is a CCK field. If I use one of the Date fields (eg Node: Posted Week) the grouping works fine. If I use a CCK field that I have created (specifically an Integer) I get a list of empty links with the totals, as above. I have tried this with two separate CCK fields, both integers.

mr.j’s picture

Further to this, I have just confirmed that if I use a CCK field of type Text instead of Integer, the summaries work as expected.

merlinofchaos’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Component: Code » Views Integration
bradweikel’s picture

Component: Views Integration » content.module
Status: Postponed (maintainer needs more info) » Active

Now that I've learned a LOT more about drupal, I've traced it this far...

For some CCK field types, including Integer, the function content_format() in content.module returns an empty string.
So if you try to use those field types as a summary

Steps to reproduce:
1. Create a new content type (let's call it NumberNode)
2. Add an Integer field (let's call it TheNumber)
3. Create a few NumberNodes
4. Create a new page view and add an Integer: TheNumber argument and set it to use summary

Result:
see above. the links that should allow you to drill into the view are empty, so you can't browse to them.

bradweikel’s picture

Version: 5.x-1.6 » 5.x-1.x-dev
Status: Active » Needs review
FileSize
537 bytes

Aha!

The content_format function doesn't handle the case that it is passed the name of a formatter that doesn't exist. The attached patch catches that case and sets it to the default formatter.

An alternative fix would be to add the missing formatter to number.module, but this fix still seems helpful and necessary to avoid recurrences of this pesky bug with other field types.

becw’s picture

Status: Needs review » Reviewed & tested by the community

I had the same issue and came to the same solution; this works and solves the problem. RTBC :)

(drupal 5.7, cck 1.6)

premanup’s picture

same for me: patch works
Drupal 1.9 cck 1.7

yched’s picture

Status: Reviewed & tested by the community » Fixed

Committed - thx !

Anonymous’s picture

Status: Fixed » Closed (fixed)

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