Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
be78796f
Commit
be78796f
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#414424
follow-up by sun: Minor follow-ups to text_format patch.
parent
56e60eb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/field/modules/text/text.js
+2
-2
2 additions, 2 deletions
modules/field/modules/text/text.js
modules/field/modules/text/text.module
+2
-4
2 additions, 4 deletions
modules/field/modules/text/text.module
modules/filter/filter.module
+12
-11
12 additions, 11 deletions
modules/filter/filter.module
with
16 additions
and
17 deletions
modules/field/modules/text/text.js
+
2
−
2
View file @
be78796f
...
...
@@ -11,8 +11,8 @@ Drupal.behaviors.textSummary = {
var
$widget
=
$
(
this
).
closest
(
'
div.field-type-text-with-summary
'
);
var
$summary
=
$widget
.
find
(
'
div.text-summary-wrapper
'
);
var
$summaryLabel
=
$summary
.
find
(
'
label
'
);
var
$full
=
$widget
.
find
(
'
div
.text-full
-wrapper
'
);
var
$fullLabel
=
$full
.
find
(
'
div.form-type-textarea
label
'
);
var
$full
=
$widget
.
find
(
'
.form-item:has(
.text-full
)
'
);
var
$fullLabel
=
$full
.
find
(
'
label
'
);
// Setup the edit/hide summary link.
var
$link
=
$
(
'
<span class="field-edit-link">(<a class="link-edit-summary" href="#">
'
+
Drupal
.
t
(
'
Hide summary
'
)
+
'
</a>)</span>
'
).
toggle
(
...
...
This diff is collapsed.
Click to expand it.
modules/field/modules/text/text.module
+
2
−
4
View file @
be78796f
...
...
@@ -521,8 +521,7 @@ function text_field_widget_form(&$form, &$form_state, $field, $instance, $langco
'#type'
=>
'textfield'
,
'#default_value'
=>
isset
(
$items
[
$delta
][
'value'
])
?
$items
[
$delta
][
'value'
]
:
NULL
,
'#size'
=>
$instance
[
'widget'
][
'settings'
][
'size'
],
'#prefix'
=>
'<div class="text-full-wrapper">'
,
'#suffix'
=>
'</div>'
,
'#attributes'
=>
array
(
'class'
=>
array
(
'text-full'
)),
);
break
;
...
...
@@ -549,8 +548,7 @@ function text_field_widget_form(&$form, &$form_state, $field, $instance, $langco
'#type'
=>
'textarea'
,
'#default_value'
=>
isset
(
$items
[
$delta
][
'value'
])
?
$items
[
$delta
][
'value'
]
:
NULL
,
'#rows'
=>
$instance
[
'widget'
][
'settings'
][
'rows'
],
'#prefix'
=>
'<div class="text-full-wrapper">'
,
'#suffix'
=>
'</div>'
,
'#attributes'
=>
array
(
'class'
=>
array
(
'text-full'
)),
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
modules/filter/filter.module
+
12
−
11
View file @
be78796f
...
...
@@ -746,8 +746,9 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE)
* If multiple text format-enabled elements are required on the same level of
* the form structure, modules can set custom #parents on the original element.
* Alternatively, the #after_build may be unset through a subsequent #process
* callback. If no custom processing occurs, then the submitted form values will
* appear like in the $form_state['input'] array above.
* callback. If the default #after_build is not invoked and no custom processing
* occurs, then the submitted form values will appear like in the
* $form_state['input'] array above.
*
* @see filter_form_after_build()
*
...
...
@@ -785,11 +786,11 @@ function filter_process_format($element) {
'#processed'
,
'#theme_wrappers'
,
);
// Move this element into sub-element 'value'.
// Move this element into sub-element 'value'.
unset
(
$element
[
'value'
]);
foreach
(
$element
as
$key
=>
$value
)
{
if
(
$key
[
0
]
===
'#'
&&
!
in_array
(
$key
,
$blacklist
))
{
$element
[
'value'
][
$key
]
=
$
value
;
foreach
(
element_properties
(
$element
)
as
$key
)
{
if
(
!
in_array
(
$key
,
$blacklist
))
{
$element
[
'value'
][
$key
]
=
$
element
[
$key
]
;
}
}
...
...
@@ -839,7 +840,6 @@ function filter_process_format($element) {
'#weight'
=>
10
,
'#attributes'
=>
array
(
'class'
=>
array
(
'filter-list'
)),
'#parents'
=>
array_merge
(
$element
[
'#parents'
],
array
(
'format'
)),
'#value_callback'
=>
'filter_form_value_callback_format'
,
);
$element
[
'format'
][
'help'
]
=
array
(
...
...
@@ -853,23 +853,24 @@ function filter_process_format($element) {
}
/**
* After build
, we need to move the
values up in $form_state.
* After build
callback to move #type 'text_format'
values up in $form_state.
*/
function
filter_form_after_build
(
$element
,
&
$form_state
)
{
$parents
=
$element
[
'#parents'
];
$original_key
=
array_pop
(
$parents
);
// For text fields, the additional subkeys map 1:1 to field schema columns.
if
(
isset
(
$element
[
'#columns'
]))
{
return
$element
;
}
$parents
=
$element
[
'#parents'
];
array_pop
(
$parents
);
foreach
(
element_children
(
$element
)
as
$key
)
{
$current_parents
=
$parents
;
switch
(
$key
)
{
case
'value'
:
form_set_value
(
array
(
'#parents'
=>
$element
[
'#parents'
]),
$element
[
$key
][
'#value'
],
$form_state
);
break
;
case
'format'
:
$current_parents
[]
=
$key
;
form_set_value
(
array
(
'#parents'
=>
$current_parents
),
$element
[
'format'
][
'format'
][
'#value'
],
$form_state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment