-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ajax): elgg/Ajax view() and form() set $vars as expected
The `elgg/Ajax` module was auto-converting any request with `options.data` to use the `POST` method. This makes sense for things like actions, which may send a large amount of form data, but it caused `$vars` to not be populated as expected because only `GET` params are injected. If you specified `options.data` with these methods before, note the server will no longer receive this data as `$_POST` on the server. Fixes #10667
- Loading branch information
Showing
7 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
<?php | |||
|
|||
if (!isset($vars['entity']) || !$vars['entity'] instanceof ElggSite) { | |||
register_error('$vars not set by ajax.form()'); | |||
} | |||
|
|||
?><p>view demo</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,8 @@ | |||
<?php | <?php | ||
// This will be fetched via ajax by the developers/ajax_example AMD module | // This will be fetched via ajax by the developers/ajax_example AMD module | ||
|
|
||
if (!isset($vars['entity']) || !$vars['entity'] instanceof ElggSite) { | |||
register_error('$vars not set by ajax.view()'); | |||
} | |||
|
|||
echo "form demo"; | echo "form demo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters