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
Fixed issue 18821: Public url is not used for SURVEYURL #3229
Fixed issue 18821: Public url is not used for SURVEYURL #3229
Conversation
Another solution can be add a LSYii_Application->getBaseUrl ? |
Yes, maybe good idea |
Put this on dev mantis maybe, we need to review App->getController()->getAbsoluteUrl() |
Doesn't work, because you would override the baseUrl all the time with configured publicurl, even when you don't need it. |
I don't understand |
Just create a Development mantis issue : https://bugs.limesurvey.org/bug_report_page.php
👍 Maybe a new function then ? I think we need it for API too. |
Some comments, maybe for the DEV branch:
|
application/models/Survey.php
Outdated
@@ -2351,7 +2357,8 @@ public function getSurveyUrl($language = null, $params = [], $preferShortUrl = t | |||
|
|||
// If short url is not preferred or no alias is found, return a traditional URL | |||
$urlParams = array_merge($params, ['sid' => $this->sid, 'lang' => $language]); | |||
$url = Yii::app()->createAbsoluteUrl('survey/index', $urlParams); | |||
$url = App()->getController()->createAbsoluteUrl('survey/index', $urlParams); |
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.
I don't like to call a controller from a model, but if no code reorg is to be done, I don't see any other way
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.
Yeah it's hard to draw the line between fixing a bug or refactor a lot of old code
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.
Maybe you can just move the code to a helper?
Maybe now is a good time to create App::createPublicUrl() ?
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.
ok, you convinced me now :)
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.
Please check my latest commit
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.
I really like it !
Fixed issue #:
New feature #:
Dev: