Wrong redirect when creating Pages when Mahara is in a subdir

Bug #1882103 reported by Philippe Adrian
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Lisa Seeto
19.04
Fix Released
High
Unassigned
19.10
Fix Released
High
Unassigned
20.04
Fix Released
High
Unassigned
20.10
Fix Released
High
Lisa Seeto

Bug Description

Referencing Bug #1843537 (https://bugs.launchpad.net/mahara/+bug/1843537)

In Mahara 20.04 this Bug seems to affect the creation of pages.

When trying to create a new page while Mahara is installed in a subdirectory (https://dns/mahara), after saving the newly created page it is created successfully but the user is redirected to an error page because wwwroot is missing.

The problem seems to be in:
mahara/htdocs/view/editlayout.php in Line 441

Much like in the CSV Upload error it does not include the root directory

The original:
redirect('/view/blocks.php?id=' . $view->get('id'));

Ammended:
redirect(get_config('wwwroot') . 'view/blocks.php?id=' . $view->get('id'));

After changing this, the saving progress redirects to the correct page.

Greetings from Germany,

Philippe

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Lisa, can you please put this through code review?

Changed in mahara:
milestone: none → 20.10.0
importance: Undecided → Medium
assignee: nobody → Lisa Seeto (lisaseeto)
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11014

Lisa Seeto (lisaseeto)
Changed in mahara:
status: New → In Progress
Revision history for this message
Octavio Jr (octavioudes) wrote :

Also line 597

$result = array(
        'error' => false,
        'message' => get_string('viewsavedsuccessfully', 'view'),
        'goto' => '/view/blocks.php?id=' . $view->get('id'),
    );

to

 $result = array(
        'error' => false,
        'message' => get_string('viewsavedsuccessfully', 'view'),
        'goto' => get_config('wwwroot') .'/view/blocks.php?id=' . $view->get('id'),
    );

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11014
Committed: https://git.mahara.org/mahara/mahara/commit/f00091e04d476315fc83ff36657399bee08eaa95
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit f00091e04d476315fc83ff36657399bee08eaa95
Author: Philippe Adrian <email address hidden>
Date: Tue Jun 9 10:22:14 2020 +1200

Bug 1882103: Wrong redirect when creating Pages when Mahara is in a subdir

-added root directory to redirect

Change-Id: I7037c2b01a84a146bc6ffc6961e4435115dd2c25

Revision history for this message
Robert Lyon (robertl-9) wrote :

There were a few more places where we needed to fix up 'goto' URLS for sites in subdirectories - including some administration forms - they were added to the patch and merged

As some of the problems cause User experience issues for normal users I'll mark this bug as high and backport to supported branches as well

Changed in mahara:
importance: Medium → High
milestone: 20.10.0 → none
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11041

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11041
Committed: https://git.mahara.org/mahara/mahara/commit/0e7b0f085787667c1a7a05f690987f1ccf7e9af8
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit 0e7b0f085787667c1a7a05f690987f1ccf7e9af8
Author: Philippe Adrian <email address hidden>
Date: Tue Jun 9 10:22:14 2020 +1200

Bug 1882103: Wrong redirect when creating Pages when Mahara is in a subdir

-added root directory to redirect

Change-Id: I7037c2b01a84a146bc6ffc6961e4435115dd2c25
(cherry picked from commit f00091e04d476315fc83ff36657399bee08eaa95)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.04_STABLE" branch: https://reviews.mahara.org/11042

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/11043

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11042
Committed: https://git.mahara.org/mahara/mahara/commit/c0f103a27fd62064d6344022a6625455c6d7f091
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.04_STABLE

commit c0f103a27fd62064d6344022a6625455c6d7f091
Author: Philippe Adrian <email address hidden>
Date: Tue Jun 9 10:22:14 2020 +1200

Bug 1882103: Wrong redirect when creating Pages when Mahara is in a subdir

-added root directory to redirect

Change-Id: I7037c2b01a84a146bc6ffc6961e4435115dd2c25
(cherry picked from commit f00091e04d476315fc83ff36657399bee08eaa95)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11043
Committed: https://git.mahara.org/mahara/mahara/commit/3b2cd82d62c7621b932dcdf122ae569666a0d8ec
Submitter: Robert Lyon (<email address hidden>)
Branch: 19.10_STABLE

commit 3b2cd82d62c7621b932dcdf122ae569666a0d8ec
Author: Philippe Adrian <email address hidden>
Date: Tue Jun 9 10:22:14 2020 +1200

Bug 1882103: Wrong redirect when creating Pages when Mahara is in a subdir

-added root directory to redirect

Change-Id: I7037c2b01a84a146bc6ffc6961e4435115dd2c25
(cherry picked from commit f00091e04d476315fc83ff36657399bee08eaa95)

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 20.10.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.