Attached patch reintroduces field styling (field.css was not being called anymore, and still had node-specific selectors).
It also overhauls a little the HTML generated for multiple fields on edit forms (d-n-d table + add more button), to something more inline with the other form elements on the page (proper .form-item class for consistent margins, <label> tag instead of just a styled <th>)

+ lol for the ahah-new-content class that got renamed to ahah-new-field during the content.module -> field.module renaming spree :-)

See screenshots for a visual hint.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Dude, where are my file attachments ?
Retry.

yched’s picture

FileSize
8.63 KB

Hem - last attempt for tonight.

yched’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

yched’s picture

Status: Needs work » Needs review
FileSize
50.63 KB
yched’s picture

FileSize
50.63 KB

sigh, wrong patch.

Status: Needs review » Needs work

The last submitted patch failed testing.

yched’s picture

Status: Needs work » Needs review
FileSize
8.42 KB

If testbot is being dense and I'm being a jerk for consistently mixing my own patches, we'll get nowhere pretty fast.

yched’s picture

FileSize
7.94 KB

Move CSS inclusion to hook_init() (like node.module does). Including it at form build time doesn't work when the form is taken out of the cache after failed validation.

yched’s picture

rerolled, just in case

yched’s picture

Rerolled, including the clear-block / clearfix rename.
+ bump - that patch is not a biggie, would be cool to have it in :-)

KarenS’s picture

FileSize
9.89 KB

I found a few more related fixes and a typo and missing widget settings for the Text module. This fix is needed to get the CCK UI working right so we can test the other field patches in the UI.

Status: Needs review » Needs work

The last submitted patch failed testing.

bjaspan’s picture

Status: Needs work » Reviewed & tested by the community

Patch applies and seems to work. Frankly, Karen and yched are the only two people who *really* understand this part of the code, so if they say it is right, I'm not sure who else's review matters.

Clearly we need to train more people on the details of Field API form handling.

bjaspan’s picture

Ooops. When I said the patch applies, I meant "after I accounted for the fact that Karen rolled it from the wrong directory." :-)

Re-rolled.

Dries’s picture

I might be wrong but I believe that ...

+    '#prefix' => '<div id="' . $field_name_url_css . '-wrapper">',
+    '#suffix' => '</div>',

... will result in XHTML validation errors. I think it will put a div inside a span.

Dries’s picture

(We should totally add XHTML validation to SimpleTest.)

bjaspan’s picture

(Re #17: Yes, automatic XHTML validation in SimpleTest would be great. Also, we should run it automatically on the redesigned d.o during development and post-launch.)

re #16: It does not appear to put a div inside a span. Here is the XHTML generated for a multi-value text widget on an edit form:

<div id="field-sample-wrapper"><div class="form-item"><table class="sticky-header" style="position: fixed; top: 0px; width: 1010px; left: 290.5px; visibility: hidden;"><thead><tr><th class="field-label" colspan="2" style="width: 997.833px;"><label>Sample: </label></th> </tr></thead></table><table class="field-multiple-table sticky-enabled tabledrag-processed sticky-table" id="field_sample_values">
 <thead class="tableHeader-processed"><tr><th class="field-label" colspan="2"><label>Sample: </label></th> </tr></thead>
<tbody>
 <tr class="draggable odd"><td class="field-multiple-drag"><a class="tabledrag-handle" href="#" title="Drag to re-order"><div class="handle"> </div></a></td><td><div id="edit-field-sample-0-value-wrapper" class="form-item">
 <input type="text" class="form-text text" value="sample field" size="60" id="edit-field-sample-0-value" name="field_sample[0][value]" maxlength="255"/>
</div>
</td><td class="delta-order" style="display: none;"><div id="edit-field-sample-0--weight-wrapper" class="form-item">
 <select id="edit-field-sample-0--weight" class="form-select field_sample-delta-order" name="field_sample[0][_weight]"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option selected="selected" value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select>
</div>
</td> </tr>
 <tr class="draggable even"><td class="field-multiple-drag"><a class="tabledrag-handle" href="#" title="Drag to re-order"><div class="handle"> </div></a></td><td><div id="edit-field-sample-1-value-wrapper" class="form-item">
 <input type="text" class="form-text text" value="value 2" size="60" id="edit-field-sample-1-value" name="field_sample[1][value]" maxlength="255"/>
</div>
</td><td class="delta-order" style="display: none;"><div id="edit-field-sample-1--weight-wrapper" class="form-item">
 <select id="edit-field-sample-1--weight" class="form-select field_sample-delta-order" name="field_sample[1][_weight]"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0">0</option><option selected="selected" value="1">1</option><option value="2">2</option><option value="3">3</option></select>
</div>
</td> </tr>
 <tr class="draggable odd"><td class="field-multiple-drag"><a class="tabledrag-handle" href="#" title="Drag to re-order"><div class="handle"> </div></a></td><td><div id="edit-field-sample-2-value-wrapper" class="form-item">
 <input type="text" class="form-text text" value="value 3" size="60" id="edit-field-sample-2-value" name="field_sample[2][value]" maxlength="255"/>
</div>
</td><td class="delta-order" style="display: none;"><div id="edit-field-sample-2--weight-wrapper" class="form-item">
 <select id="edit-field-sample-2--weight" class="form-select field_sample-delta-order" name="field_sample[2][_weight]"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0">0</option><option value="1">1</option><option selected="selected" value="2">2</option><option value="3">3</option></select>
</div>
</td> </tr>
 <tr class="draggable even"><td class="field-multiple-drag"><a class="tabledrag-handle" href="#" title="Drag to re-order"><div class="handle"> </div></a></td><td><div id="edit-field-sample-3-value-wrapper" class="form-item">
 <input type="text" class="form-text text" value="" size="60" id="edit-field-sample-3-value" name="field_sample[3][value]" maxlength="255"/>
</div>
</td><td class="delta-order" style="display: none;"><div id="edit-field-sample-3--weight-wrapper" class="form-item">
 <select id="edit-field-sample-3--weight" class="form-select field_sample-delta-order" name="field_sample[3][_weight]"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0">0</option><option value="1">1</option><option value="2">2</option><option selected="selected" value="3">3</option></select>
</div>
</td> </tr>
</tbody>
</table>
<div class="clearfix"><input type="submit" class="form-submit field-add-more-submit ahah-processed" value="Add another item" id="edit-field-sample-field-sample-add-more" name="field_sample_add_more"/>
</div></div></div>

I don't see a span anywhere. The prefix and suffix are wrapping another div.

NOTE: There is currently a bug in the CCK UI; you can't create a multi-value field with it. I worked around the bug by changing the 'cardinality' column of a field in field_config table directly. :-)

KarenS’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
9.96 KB

The bug in CCK UI is fixed and you can now use it to test these patches.

I found one more css change, the last few lines in this patch. I needed to make the css rule a bit more specific to get the width of text and number fields to display in the right width instead of spanning the whole width of the page.

I already know this patch will fail the bot's testing because it doesn't appear to come from the right location, but I have tried re-rolling it from every possible place I can think of and I get the same result. It is either a problem with Tortoise or my understanding of how to roll a patch, so I'll let someone else re-roll it into something the bot will like.

Status: Needs review » Needs work

The last submitted patch failed testing.

KarenS’s picture

Most of these changes just got committed in http://drupal.org/cvs?commit=181304. My last change to the .css got missed but it looks like everything else in this patch got committed there. I'll post a new patch with the incremental change in a moment.

KarenS’s picture

Status: Needs work » Needs review
FileSize
508 bytes

Here's another patch that will fail because it has the wrong root. I just spent an hour trying to find a way to get Tortoise to show the path in the file name and have given up, so someone will need to re-roll this patch for me.

Once re-rolled into a format the bot likes it should be a very simple no-brainer. The change is needed so the fields will obey the widget settings for the size of the input field.

Status: Needs review » Needs work

The last submitted patch failed testing.

yched’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
616 bytes

Same as #22, rolled from root.
I didn't participated in that followup patch, so I can set to RTBC.

bjaspan’s picture

Status: Reviewed & tested by the community » Needs work

The version of this patch accidentally committed with #392686: Switch to serial primary keys added 'widget_settings' to the structure returned by hook_field_info() (at least in text.module) which is only supposed to return info about field types, not widgets.

KarenS’s picture

The last issue affects only the text module and is fixed in #372743: Body and teaser as fields, so if that gets in this is fixed.

yched’s picture

Status: Needs work » Fixed

Fixed now.

Status: Fixed » Closed (fixed)

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