Hi..
Have a nice clean install of D6.22, Addresses 1.11, and CCK 2.9.

I created a new content type utilizing addresses, chose which one I wanted to display, given them appropriate size, and labels. All seemed well.

I go to create content -> content type, and the text fields extend the entire length of the page, ignoring any sizing. I am using Safari for development.

Yet, when I go back to manage the address field, and expose the default values, it does present the fields with proper lengths as it should in the create content forms.

Other text fields I have set the sizes upon, show properly. Only the address fields are not appearing as I have defined.

Any thoughts, opinions, ideas, insights would be appreciated.
Cheers
Murias

CommentFileSizeAuthor
#5 addresses-6.x-cck_class_text-1.x.patch452 bytesAlexisWilke
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AlexisWilke’s picture

Murias,

Did you check the <input ...> tags? Was the size="..." attribute defined in them? If it was, was it set to 60? (the system default)

I thought that the size was used for the maximum number of characters one can enter and not the actual width of the widget (at least in this case.)

Thank you.
Alexis Wilke

murias’s picture

I have just checked under FireFox and the issue is identical.

@AlexisWhite There is a size attribute defined in the actual source of the create content form, and it is the size as input into the address field management through CCK. The source for the text field itself is identical to the source of the text field at manage content -> type -> manage fields, then showing "default values". Here it does display as expected. Albeit, the wrappers are different, as this is in the cck form and not the creation of content form.

Maybe there is a problem with the wrappers?

here is a snippet of source from the cck default value area:

<input type="text" maxlength="255" name="default_value_widget[field_show_venue_address][0][city]" id="edit-default-value-widget-field-show-venue-address-0-city" size="25" value="" class="form-text">

here is a snippet of source from the form to create the content itself:

<input type="text" maxlength="255" name="field_show_venue_address[0][city]" id="edit-field-show-venue-address-0-city" size="25" value="" class="form-text required">

Hoping that this helps some...

BTW... thanx for quick response.
Cheers
Murias

AlexisWilke’s picture

Good! Then the size parameter works.

The other problem I ran into with input tags are themes with stuff like this:

input {
  width: 100%;
}

This means the size="25" is used to define the number of characters to show, but then the CSS file tells it to extend that 100% of the parent. Some fields may work because they have a corresponding fix in the CSS.

This being said, I'm not so sure that would be the case with CCK fields, but I would check the style sheet with Chrome to have a better idea of what's going on.

Thank you.
Alexis

murias’s picture

I am surely appreciating your assist here. You are pointing me in the proper directions for sure.

I have done a couple of things, I hope I am not giving too much information. Always strange that fine line between too much and not enough info.

I looked closely at the source that came out of an addresses field and that of which comes from a standard text field into the content creation forms, including wrappers. Look rather close enough for government work.
addresses field:

<div class="form-item" id="edit-field-show-venue-address-0-province-wrapper">
 <label for="edit-field-show-venue-address-0-province">State: </label>
 <input type="text" maxlength="16" name="field_show_venue_address[0][province]" id="edit-field-show-venue-address-0-province" size="2" value="" class="form-text" />
</div>

normal text field:

<div class="form-item" id="edit-field-show-cover-charge-0-value-wrapper">
 <label for="edit-field-show-cover-charge-0-value">Cover Charge: </label>
 <input type="text" name="field_show_cover_charge[0][value]" id="edit-field-show-cover-charge-0-value" size="5" value="" class="form-text text" />
</div>

major difference that I see is the extra text class in the normal text input field..... think this makes a big difference.

I then did the ever popular inspect element inside the browser on the actual addresses field which I provided source for above. You were almost right on the money. I found the offending width. The class form-text in /modules/node/node.css is the culprit with a width of 95%. I uncheck the box(in inspect element section of browser), and poof, the size is as expected. I went through my theme, which is still "stock" AdaptiveTheme, and no overrides. Fields also display the exact improper way in Garland.

The css which is causing the addresses fields to be overly long is part of Drupal core, at least in 6. Basic CCK fields (the ones that come with CCK) add the "text" class after the "form-text" class, some other CCK modules add the "clear-block" class to their main wrapper, or add the "text" class. Might it not be good for Addresses CCK to do the same? Then maybe this would go away completely. Unless I am completely looking at the wrong tree, this is completely between Core and Addresses?

Cheers
and again I am appreciating this greatly
Murias

AlexisWilke’s picture

Category: support » bug
FileSize
452 bytes

murias,

Good finding. If you would please check out the attached patch and let me know whether that solves your problem.

Thank you.
Alexis Wilke

murias’s picture

Judging from how many modules and patches you have contributed, I think you alrady know how this one has come out.

Works flawlessly now.

Sure I speak for more than just myself. Thank you for your quick work on this.

And now I feel as I have actually done something that the rest of the community has the ability to truly benefit from, albeit small. ;)

AlexisWilke’s picture

Assigned: Unassigned » AlexisWilke
Status: Active » Fixed

Good. 8-)

Thank you for the nice words.
Alexis

See: http://drupalcode.org/project/addresses.git/commit/b0bc7f6

Status: Fixed » Closed (fixed)

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