Skip to content

Commit 6f9d01f

Browse files
committed
API FormField->setDescription() visible in default template
Renders into <span class="description"> instead of "title" attribute
1 parent 255b4c4 commit 6f9d01f

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

docs/en/changelogs/3.1.0.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ you'll need to adjust your code.
6060
including `Email_BounceHandler` and `Email_BounceRecord` classes,
6161
as well as the `Member->Bounced` property.
6262
* Deprecated global email methods `htmlEmail()` and `plaintextEmail`, as well as various email helper methods like `encodeMultipart()`. Use the `Email` API, or the `Mailer` class where applicable.
63-
* Removed non-functional `$inlineImages` option for sending emails
63+
* Removed non-functional `$inlineImages` option for sending emails
6464
* Removed support for keyed arrays in `SelectionGroup`, use new `SelectionGroup_Item` object
6565
to populate the list instead (see [API docs](api:SelectionGroup)).
66-
* Removed `Form->Name()`: Use getName()
66+
* `FormField->setDescription()` now renders in a `<span class="description">` by default, rather than a `title` attribute * Removed `Form->Name()`: Use getName()
6767
* Removed `FormField->setContainerFieldSet()`: Use setContainerFieldList()
6868
* Removed `FormField->rootFieldSet()`: Use rootFieldList()
6969
* Removed `Group::map()`: Use DataList::("Group")->map()

forms/FormField.php

-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ public function getAttributes() {
356356
'class' => $this->extraClass(),
357357
'id' => $this->ID(),
358358
'disabled' => $this->isDisabled(),
359-
'title' => $this->getDescription(),
360359
);
361360

362361
return array_merge($attrs, $this->attributes);

templates/forms/CheckboxSetField.ss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ul id="$ID" class="$extraClass"<% if Description %> title="$Description"<% end_if %>>
1+
<ul id="$ID" class="$extraClass">
22
<% if Options.Count %>
33
<% loop Options %>
44
<li class="$Class">

templates/forms/FormField.ss

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<% if isReadonly %>
2-
<span id="$ID"
3-
<% if extraClass %>class="$extraClass"<% end_if %>
4-
<% if $Description %>title="$Description"<% end_if %>>
2+
<span id="$ID"<% if extraClass %> class="$extraClass"<% end_if %>>
53
$Value
64
</span>
75
<% else %>

templates/forms/FormField_holder.ss

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
</div>
66
<% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %>
77
<% if Message %><span class="message $MessageType">$Message</span><% end_if %>
8+
<% if Description %><span class="description">$Description</span><% end_if %>
89
</div>

templates/forms/OptionsetField.ss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ul id="$ID" class="$extraClass"<% if Description %> title="$Description"<% end_if %>>
1+
<ul id="$ID" class="$extraClass">
22
<% loop Options %>
33
<li class="$Class">
44
<input id="$ID" class="radio" name="$Name" type="radio" value="$Value"<% if isChecked %> checked<% end_if %><% if isDisabled %> disabled<% end_if %> />

0 commit comments

Comments
 (0)