Skip to content

Commit

Permalink
Merge branch '4.3-dev' into 4.3-dev-friday_2
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Jul 26, 2023
2 parents 2b7951a + ce7431f commit c6a8ebe
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
label="JOPTION_SELECT_STAGE"
class="js-select-submit-on-change"
activeonly="true"
extension="com_content"
extension="com_content.article"
>
<option value="">JOPTION_SELECT_STAGE</option>
</field>
Expand Down
33 changes: 17 additions & 16 deletions administrator/components/com_fields/src/Model/GroupModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,29 +240,30 @@ protected function preprocessForm(Form $form, $data, $group = 'content')

$parts = FieldsHelper::extract($this->state->get('filter.context'));

// If we don't have a valid context then return early
if (!$parts) {
return;
}

// Extract the component name
$component = $parts[0];

// Extract the optional section name
$section = (count($parts) > 1) ? $parts[1] : null;
// Extract the section name
$section = $parts[1];

if ($parts) {
// Set the access control rules field component value.
$form->setFieldAttribute('rules', 'component', $component);
}
// Set the access control rules field component value.
$form->setFieldAttribute('rules', 'component', $component);

if ($section !== null) {
// Looking first in the component models/forms folder
$path = Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fieldgroup/' . $section . '.xml');
// Looking first in the component models/forms folder
$path = Path::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fieldgroup/' . $section . '.xml');

if (file_exists($path)) {
$lang = Factory::getLanguage();
$lang->load($component, JPATH_BASE);
$lang->load($component, JPATH_BASE . '/components/' . $component);
if (file_exists($path)) {
$lang = Factory::getLanguage();
$lang->load($component, JPATH_BASE);
$lang->load($component, JPATH_BASE . '/components/' . $component);

if (!$form->loadFile($path, false)) {
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
}
if (!$form->loadFile($path, false)) {
throw new \Exception(Text::_('JERROR_LOADFILE_FAILED'));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>

<?php //Load the batch processing form. ?>
<?php // Load the batch processing form. ?>
<?php
if (
$user->authorise('core.create', $component)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<?php // load the pagination. ?>
<?php echo $this->pagination->getListFooter(); ?>

<?php //Load the batch processing form. ?>
<?php // Load the batch processing form. ?>
<?php
if (
$user->authorise('core.create', $component)
Expand Down
24 changes: 23 additions & 1 deletion build/media_source/plg_system_guidedtours/js/guidedtours.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,35 @@ function addStepToTourButton(tour, stepObj, buttons) {
if (target.tagName.toLowerCase() === 'iframe') {
// Give blur to the content of the iframe, as iframes don't have blur events
target.contentWindow.document.body.addEventListener('blur', (event) => {
if (!sessionStorage.getItem('tourId')) {
return;
}
setTimeout(() => {
setFocus(primaryButton, secondaryButton, cancelButton);
}, 1);
event.preventDefault();
});
} else if (target.tagName.toLowerCase() === 'joomla-field-fancy-select') {
target.querySelector('.choices input').addEventListener('blur', (event) => {
if (!sessionStorage.getItem('tourId')) {
return;
}
setFocus(primaryButton, secondaryButton, cancelButton);
event.preventDefault();
});
} else if (target.parentElement.tagName.toLowerCase() === 'joomla-field-fancy-select') {
target.querySelector('input').addEventListener('blur', (event) => {
if (!sessionStorage.getItem('tourId')) {
return;
}
setFocus(primaryButton, secondaryButton, cancelButton);
event.preventDefault();
});
} else {
target.addEventListener('blur', (event) => {
if (!sessionStorage.getItem('tourId')) {
return;
}
setFocus(primaryButton, secondaryButton, cancelButton);
event.preventDefault();
});
Expand Down Expand Up @@ -356,6 +368,9 @@ function startTour(obj) {
switch (obj.steps[index].interactive_type) {
case 'submit':
ele.addEventListener('click', () => {
if (!sessionStorage.getItem('tourId')) {
return;
}
sessionStorage.setItem('currentStepId', obj.steps[index].id + 1);
});
break;
Expand All @@ -364,6 +379,9 @@ function startTour(obj) {
ele.step_id = index;
if (ele.hasAttribute('required') && ['email', 'password', 'search', 'tel', 'text', 'url'].includes(ele.type)) {
['input', 'focus'].forEach((eventName) => ele.addEventListener(eventName, (event) => {
if (!sessionStorage.getItem('tourId')) {
return;
}
if (event.target.value.trim().length) {
enableButton(event);
} else {
Expand All @@ -374,7 +392,11 @@ function startTour(obj) {
break;

case 'button':
tour.next();
ele.addEventListener('click', () => {
// the button may submit a form so record the currentStepId in the session storage
sessionStorage.setItem('currentStepId', obj.steps[index].id + 1);
tour.next();
});
break;

case 'other':
Expand Down
5 changes: 5 additions & 0 deletions libraries/src/Exception/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public static function render(\Throwable $error)
$app->redirect('index.php');
}

// Clear all opened Output buffers to prevent misrendering
for ($i = 0, $l = ob_get_level(); $i < $l; $i++) {
ob_end_clean();
}

/*
* Try and determine the format to render the error page in
*
Expand Down

0 comments on commit c6a8ebe

Please sign in to comment.