J4 Issue ?
avatar coolcat-creations
coolcat-creations
6 Mar 2019

What needs to be fixed

When something is edited from a shortcut link, for example like here: #23934 the user should be redirected to the origin he came from

If you edit the module and close it, you end up in the module manager. It would be good to implement a refererlink on such icons so when you close something you get back to where you came from.

@infograf768 tagging you because of your + vote ;)

avatar coolcat-creations coolcat-creations - open - 6 Mar 2019
avatar joomla-cms-bot joomla-cms-bot - change - 6 Mar 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Mar 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 8 Mar 2019

This change works fine here for #23934

diff --git a/administrator/components/com_modules/tmpl/module/edit.php b/administrator/components/com_modules/tmpl/module/edit.php
index 6ed075f..8a076bb 100644
--- a/administrator/components/com_modules/tmpl/module/edit.php
+++ b/administrator/components/com_modules/tmpl/module/edit.php
@@ -15,4 +15,5 @@
 use Joomla\CMS\Layout\LayoutHelper;
 use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
 
 HTMLHelper::_('behavior.formvalidator');
@@ -198,4 +199,10 @@
 		<?php echo $this->form->getInput('module'); ?>
 		<?php echo $this->form->getInput('client_id'); ?>
+
+		<?php // Redirect to CPanel when the module has been edited from there. ?>
+		<?php $url = htmlspecialchars($_SERVER['HTTP_REFERER']); ?>
+		<?php if ($this->item->client_id == 1 && ($url == Uri::root() . 'administrator/index.php' || $url == Uri::root() . 'administrator/index.php?option=com_cpanel')) : ?>
+			<input type="hidden" name="return" value="<?php echo base64_encode('index.php?option=com_cpanel') ?>">
+		<?php endif; ?>
 	</div>
 </form>

I guess we also could use a code using session.
Not sure what is the best solution

avatar coolcat-creations
coolcat-creations - comment - 8 Mar 2019

Ok I guess after the edit is merged I or @C-Lodder can add this "fix" to the module or should this fix be done to all possible places? Then the places should be maybe listed.
I can think of - edit userprofile ... but which else?

avatar infograf768
infograf768 - comment - 8 Mar 2019

we must first decide if we should use that kind of code or not.

avatar infograf768
infograf768 - comment - 8 Mar 2019

after some discussion, that code is not the right way.
will test another and, if it works fine, will make pr

avatar infograf768
infograf768 - comment - 8 Mar 2019

I wait for @C-Lodder pr to be merged to propose the patch as the main change is in fact in the url in modules.php

avatar coolcat-creations
coolcat-creations - comment - 8 Mar 2019

Thank you :)

avatar infograf768
infograf768 - comment - 21 Mar 2019

Please test #24109 for the CPanel modules

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Mar 2019

@infograf768 #23934 to test.

avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-03-21 08:18:48
Closed_By joomla-cms-bot
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Mar 2019
Closed_Date 2019-03-21 08:18:48 2019-03-21 08:18:49
Closed_By joomla-cms-bot franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - close - 21 Mar 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 21 Mar 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Mar 2019

closed as having Pull Request #23934

avatar infograf768
infograf768 - comment - 21 Mar 2019

@franz-wohlkoenig
#23934 was merged and that is why I could make the new PR :)

I reopen this as it did not only concern the cpanel modules but eventually other places in core where the redirect would be nice to implement.

Please, all, state which precise places.

avatar infograf768 infograf768 - change - 21 Mar 2019
Status Closed New
Closed_Date 2019-03-21 08:18:49
Closed_By franz-wohlkoenig
avatar infograf768 infograf768 - reopen - 21 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Mar 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 21 Mar 2019

@chmst
Also proposed for Edit Account
#24281

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Mar 2019
Category UI/UX
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar brianteeman
brianteeman - comment - 20 May 2019

This should be closed. The original issue has been resolved as have lots of other similar "return to origin" issues. If there are any new links that need to "return to origin" then they should be in their own new issue/pr

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 May 2019

closed as stated above.

avatar franz-wohlkoenig franz-wohlkoenig - change - 20 May 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-05-20 07:34:12
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 20 May 2019

Add a Comment

Login with GitHub to post a comment