Hi,

I'm not sure if this is a fivestar issue, a views issue or maybe it's something that can be fixed by doing this another way...

I'm generating a view that contains the rating for the nodes in question. The View basic settings that I guess could be affecting the output are;

Style: Unformatted
Row style: Fields

My problem is that the widget is being generated within a span;

<div class="views-field-value"><span class="field-content"><div>fivestar content</div></span></div>

After taking a look at views-view-fields.tpl.php I noticed there's a comment that says

// $field->element_type is either SPAN or DIV depending upon whether or not
// the field is a 'block' element type or 'inline' element type.

The code that follows that (difficult to paste into here without breaking things) then goes on to insert either

<span class="field-content">

or

<div class="field-content">

depending on the value of $field->element_type

Has anyone come across this before or have a possible solution that doesn't involve changing the View style to Table etc.

Many thanks :)

Comments

deviantintegral’s picture

Version: 6.x-1.19 » 7.x-2.x-dev
Category: support » bug
Status: Active » Needs review
StatusFileSize
new2.97 KB
new2.86 KB

Actually, I think this is a problem with the static widget. It's assuming that it's being placed within a block-level element, which is rarely the case with views. There's no reason why it can't be a span instead. Here's a pair of patches that changes all of the divs in them_fivestar_static to spans, which fixes the validation issues. Note that this would affect any sites that are theming the div specifically, so we should probably call it out in the next set of release notes.

Status: Needs review » Needs work

The last submitted patch, 660772.1-widget-static-span-7.x.patch, failed testing.

deviantintegral’s picture

StatusFileSize
new28.48 KB

Here's a patch that removes the divs from all widgets, passes tests, and fixes a few typos. Individual commits at the moment so the changes are easy to see, but feel free to squish this down.

deviantintegral’s picture

Status: Needs work » Needs review
dbt102’s picture

Issue summary: View changes

+1 bumb

joelpittet’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

This looks good but needs to be re-rolled as upstream changes have made the patch unable to apply:

patching file css/fivestar.css
patching file includes/fivestar.theme.inc
Hunk #1 FAILED at 188.
Hunk #2 FAILED at 200.
Hunk #3 succeeded at 218 (offset 6 lines).
2 out of 3 hunks FAILED -- saving rejects to file includes/fivestar.theme.inc.rej
patching file widgets/basic/basic-rtl.css
patching file widgets/basic/basic.css
patching file widgets/craft/craft-rtl.css
patching file widgets/craft/craft.css
patching file widgets/drupal/drupal.txt
patching file widgets/flames/flames-rtl.css
patching file widgets/flames/flames.css
patching file widgets/hearts/hearts-rtl.css
patching file widgets/hearts/hearts.css
patching file widgets/lullabot/lullabot.txt
patching file widgets/minimal/minimal-rtl.css
patching file widgets/minimal/minimal.css
patching file widgets/outline/outline-rtl.css
patching file widgets/outline/outline.css
patching file widgets/oxygen/oxygen-rtl.css
patching file widgets/oxygen/oxygen.css
patching file widgets/small/small-rtl.css
patching file widgets/small/small.css
patching file test/fivestar.field.test
Hunk #1 succeeded at 32 (offset 4 lines).
Hunk #2 succeeded at 79 (offset 12 lines).
Hunk #3 succeeded at 159 (offset 12 lines).
Hunk #4 succeeded at 167 (offset 12 lines).
patching file test/fivestar.field.test
Hunk #1 FAILED at 21.
Hunk #2 succeeded at 168 (offset 12 lines).
dbt102’s picture

Status: Needs work » Needs review
StatusFileSize
new23.46 KB

Status: Needs review » Needs work

The last submitted patch, 7: 660772-invalid_output_for_xhtml1-strictdtd_in_views-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

dbt102’s picture

adding codesniffer fix to patch and rm test changes to see if the patch will pass

dbt102’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: 660772-invalid_output_for_xhtml1-strictdtd_in_views-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.