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
38abc065
Commit
38abc065
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#544418
by sun: small follow-up on new AJAX framework.
parent
cca5a914
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/ajax.inc
+6
-3
6 additions, 3 deletions
includes/ajax.inc
with
6 additions
and
3 deletions
includes/ajax.inc
+
6
−
3
View file @
38abc065
...
...
@@ -24,7 +24,7 @@
* a different callback function to invoke, which can return updated HTML or can
* also return a richer set of AJAX framework commands.
*
* @see ajax_commands
* @see
@link
ajax_commands
AJAX framework commands @endlink
*
* To implement AJAX handling in a normal form, just add '#ajax' to the form
* definition of a field. That field will trigger an AJAX event when it is
...
...
@@ -74,7 +74,7 @@
* be converted to a JSON object and returned to the client, which will then
* iterate over the array and process it like a macro language.
*
* @see ajax_commands
* @see
@link
ajax_commands
AJAX framework commands @endlink
*
* Each command is an object. $object->command is the type of command and will
* be used to find the method (it will correlate directly to a method in
...
...
@@ -179,6 +179,7 @@ function ajax_get_form() {
// system/ajax without actually viewing the concerned form in the browser.
// This is likely a hacking attempt as it never happens under normal
// circumstances, so we just do nothing.
watchdog
(
'ajax'
,
'Invalid form POST data.'
,
array
(),
WATCHDOG_WARNING
);
exit
;
}
...
...
@@ -216,7 +217,8 @@ function ajax_form_callback() {
// If the returned value is a string, assume it is HTML and create
// a command object to return automatically.
if
(
is_string
(
$html
))
{
$commands
=
array
(
ajax_command_replace
(
NULL
,
$html
));
$commands
=
array
();
$commands
[]
=
ajax_command_replace
(
NULL
,
$html
);
}
// Otherwise, $html is supposed to be an array of commands, suitable for
// Drupal.ajax, so we pass it on as is.
...
...
@@ -333,6 +335,7 @@ function ajax_process_form($element) {
/**
* @defgroup ajax_commands AJAX framework commands
* @{
* @ingroup ajax
*/
/**
...
...
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