Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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!
Comment | File | Size | Author |
---|---|---|---|
#6 | missing_formatter.patch | 537 bytes | bradweikel |
view_with_blank_summary_links.txt | 1.17 KB | bradweikel |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedWhere the text comes from is dependent upon the argument you're using, which you neglected to specify.
Comment #2
mr.j CreditAttribution: mr.j commentedI 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.
Comment #3
mr.j CreditAttribution: mr.j commentedFurther to this, I have just confirmed that if I use a CCK field of type Text instead of Integer, the summaries work as expected.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedComment #5
bradweikel CreditAttribution: bradweikel commentedNow 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.
Comment #6
bradweikel CreditAttribution: bradweikel commentedAha!
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.
Comment #7
becw CreditAttribution: becw commentedI had the same issue and came to the same solution; this works and solves the problem. RTBC :)
(drupal 5.7, cck 1.6)
Comment #8
premanup CreditAttribution: premanup commentedsame for me: patch works
Drupal 1.9 cck 1.7
Comment #9
yched CreditAttribution: yched commentedCommitted - thx !
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.