1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 08:44:46 +02:00
This commit is contained in:
Ryan Cramer
2025-04-17 11:59:47 -04:00
parent 725d89e664
commit 570bdb4b81
5 changed files with 9 additions and 3 deletions

View File

@@ -190,6 +190,8 @@ $(document).ready(function() {
}
postUrl += (postUrl.indexOf('?') > -1 ? '&' : '?') + 'InputfieldFileAjax=1';
var $f = $('#Inputfield_id');
if($f.length) postUrl += '&eid=' + $f.val();
// CSRF protection
var $postToken = $form.find('input._post_token');

File diff suppressed because one or more lines are too long

View File

@@ -1508,7 +1508,9 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel
$hasPage = $this->hasPage;
if($hasPage && wireInstanceOf($hasPage, 'RepeaterPage')) {
$process = $this->wire()->process;
if($process instanceof WirePageEditor && $process->getPage()->id === $hasPage->id) {
$eid = (int) $this->wire()->input->get('eid');
if(!$eid) $eid = $process->getPage()->id;
if($process instanceof WirePageEditor && $eid === $hasPage->id) {
// repeater page being edited directly or in front-end modal
// so no '_repeater' suffix is necessary here
} else if(strpos($this->name, '_repeater') === false) {

View File

@@ -1663,6 +1663,8 @@ function InputfieldImage($) {
}
postUrl += (postUrl.indexOf('?') > -1 ? '&' : '?') + 'InputfieldFileAjax=1';
var $f = $('#Inputfield_id');
if($f.length) postUrl += '&eid=' + $f.val();
if(fieldName.indexOf('[') > -1) fieldName = fieldName.slice(0,-2); // trim trailing []

File diff suppressed because one or more lines are too long