New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added "Continue" link to error page (#40909) #40910
base: master
Are you sure you want to change the base?
Conversation
User can quickly return to the starting page when encountering an error.
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
href="/" is not always correct.
There are two config variables that need to be taken into account:
/**
* Define the Web base URL
* This key is necessary for the navigation item to the new ownCloud Web UI and for redirecting
* public and private links.
*/
'web.baseUrl' => '',
/**
* Define clean URLs without `/index.php`
* This parameter will be written as `RewriteBase` on update and installation of
* ownCloud to your `.htaccess` file. While this value is often simply the URL
* path of the ownCloud installation it cannot be set automatically properly in
* every scenario and needs thus some manual configuration.
*
* In a standard Apache setup this usually equals the folder that ownCloud is
* accessible at. So if ownCloud is accessible via `https://mycloud.org/owncloud`
* the correct value would most likely be `/owncloud`. If ownCloud is running
* under `https://mycloud.org/` then it would be `/`.
*
* Note that the above rule is not valid in every case, as there are some rare setup
* cases where this may not apply. However, to avoid any update problems this
* configuration value is explicitly opt-in.
*
* After setting this value run `{occ-command-example-prefix} maintenance:update:htaccess`. Now, when the
* following conditions are met ownCloud URLs won't contain `index.php`:
*
* - `mod_rewrite` is installed
* - `mod_env` is installed
*/
'htaccess.RewriteBase' => '/',
ownCloud may also be installed like this:
https://oc10130a1-20230807.jw-qa.owncloud.works/mammamia/owncloud/login
config.php: 'htaccess.RewriteBase' => '/mammamia/owncloud',
https://oc1012-index-20230807.jw-qa.owncloud.works/index.php
No RewriteBase in config.php
https://oc10122-both-20230807.jw-qa.owncloud.works/big-bang/index.php
apache.conf: Alias /big-bang "/var/www/owncloud/"
without a RewriteBase in config.php
https://oc10130a1-web-app-20230807.jw-qa.owncloud.works/index.php
... and what happens with the new web UI? (Optional, but it should not break...)
Kudos, SonarCloud Quality Gate passed! |
Now not only at the error page (template error.php) but also at the 403 page (template 403.php) IL10N is not working for "Continue", but as part of the message is in english anyway, this is a fix for later.
Fixed on 403 page, too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work in all my test cases.
- admin permission, wrong file id
- index.php less and other
- / and subfolder install.
Sidenote: The string "Logged in user must be an admin" seems to be untranslated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Should we make the "Continue" prettier. Maybe under the message box? But fine for me.
- CI is failing https://drone.owncloud.com/owncloud/core/38908/3/7
- Please add a changelog entry Added "Continue" link to error page (#40909) #40910 (comment)
- Added additional reviewers since we worked on the code together ;)
I made this to be working correctly So it could be an accepted feature for the next release. I planed to polish code, style and translation next during beta. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's easy to add some basic unit tests.
$template->assign('continue_text', "Continue"); | ||
$template->assign('base_url', \OC::$server->getURLGenerator()->getAbsoluteURL("/")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be needed. Variable assignment for the template should be already done in the foreach loop above.
'error', | ||
[ | ||
"errors" => [$param], | ||
"base_url" => \OC::$server->getURLGenerator()->getAbsoluteURL("/"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to inject the URLGenerator
?
Description
Related Issue
Motivation and Context
User can quickly return to the starting page when encountering an error.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: