View Issue Details

This bug affects 4 person(s).
 38
IDProjectCategoryView StatusLast Update
18961Bug reports_ Unknownpublic2023-09-22 19:04
Reporterjuliodiz Assigned Togabrieljenik  
PriorityhighSeverityblock 
Status feedbackResolutionopen 
Product Version6.1.x 
Summary18961: {SURVEYURL} didn't work with plugin using cli event
Description

{SURVEYURL} don't show complete URL

/index.php/215424?token=test1&lang=en-US

Steps To Reproduce

Steps to reproduce

Use {SURVEYURL}

Expected result

https://survey.com/index.php/215424?token=test1&lang=en-US

Actual result

/index.php/215424?token=test1&lang=en-US

TagsNo tags attached.
Bug heat38
Complete LimeSurvey version number (& build)6.1
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMariaDB
Server OS (if known)
Webserver software & version (if known)
PHP Version7.4.29

Relationships

related to 18960 closedollehar Don't create URL using @@SURVEYURL@@ 

Users monitoring this issue

Activities

juliodiz

juliodiz

2023-07-18 01:47

reporter   ~76116

Email Placeholders

juliodiz

juliodiz

2023-07-18 02:23

reporter   ~76119

Application Models Survey

    //$url = App()->createUrl('survey/index', $urlParams);
    $url = App()->createPublicUrl('survey/index', $urlParams);
ollehar

ollehar

2023-07-18 10:48

administrator   ~76121

Can you tell us which file and line you're suggesting a change?

ollehar

ollehar

2023-07-18 10:48

administrator   ~76122

Oh, the Survey model. Will check.

ollehar

ollehar

2023-07-18 11:01

administrator   ~76123

Hello juliodiz,
This should already be fixed in recent versions.
Can you please check if this issue still exists in the latest version of LimeSurvey and let us know?
Thank you!

juliodiz

juliodiz

2023-07-18 15:26

reporter   ~76137

Thanks!
Same problem here
I am using last version Confort Update and still having this issue.

juliodiz

juliodiz

2023-07-22 03:54

reporter   ~76235

[2023-07-21T22:44:11-03:00] [INFO] Start sendMailByCron for 455337
CException: ConsoleApplication and its behaviors do not have a method or closure named "createPublicUrl". in /var/www/public/vendor/yiisoft/yii/framework/base/CComponent.php:266
Stack trace:
#0 /var/www/public/application/models/Survey.php(2355): CComponent->__call('createPublicUrl', Array)

Problem when using

/usr/bin/php /var/www/public/application/commands/console.php plugin cron --interval=1

juliodiz

juliodiz

2023-07-24 15:17

reporter   ~76243

Its not working using the php script console to run and send the email.

juliodiz

juliodiz

2023-07-24 18:00

reporter   ~76252

Need to change
$url = App()->createUrl('survey/index', $urlParams);
to
$url = App()->createAbsoluteUrl('survey/index', $urlParams);

Mazi

Mazi

2023-08-15 10:21

updater   ~76589

We are facing the same "CException: ConsoleApplication and its behaviors do not have a method or closure named "createPublicUrl"" problem. Our inviter and reminder cronjob scripts (https://survey-consulting.com/product-category/limesurvey-plugins/limesurvey-cronjob-scripts) are showing an error when being run on console.
This problem showed up just recently at the latest 5.6.33 version.

bismark

bismark

2023-08-16 11:15

reporter   ~76612

please also fix the 5.x branch

DenisChenu

DenisChenu

2023-08-24 08:32

developer   ~76692

What is the timeframe for fixing this issue ?
Currently : all console plugin sending mail are broken.

Mazi

Mazi

2023-08-24 09:15

updater   ~76693

I'd also like to second that this issue breaks many of our plugins, so a fast fix would be much appreciated.

When applying similar changes in the future, please keep such console things in mind. This was broken several times in the past.

francois-charles.hebert

francois-charles.hebert

2023-08-24 15:49

reporter   ~76695

The bug exist in version 5.6.34, but not in 5.6.16!

DenisChenu

DenisChenu

2023-08-24 16:16

developer   ~76698

Was related to new feature «Survey alias»

DenisChenu

DenisChenu

2023-09-12 08:30

developer   ~76952

@ollehar : if you don't have time : i need it before try fixing sendMailCron,
Then : you can assign it to me.

gabrieljenik

gabrieljenik

2023-09-12 17:44

manager   ~76962

I was just asking this morning about this ticket.
We can take it.
Let me know if you want me to take it or you prefer to do it.

Thanks

DenisChenu

DenisChenu

2023-09-12 17:45

developer   ~76963

If you think you can fix before end of week : feel free to take it.

DenisChenu

DenisChenu

2023-09-13 17:12

developer   ~77014

@gabrieljenik : remind the publicurl config settings :)

gabrieljenik

gabrieljenik

2023-09-13 17:52

manager   ~77015

Sure... Let me work a bit on it and push something...

gabrieljenik

gabrieljenik

2023-09-18 14:09

manager   ~77120

Last edited: 2023-09-18 14:09

v5: https://github.com/LimeSurvey/LimeSurvey/pull/3454

Please consider the following when reviewing:
Had to add these to the config:

As this is only required when running ConsoleApplication, maybe there is the need of having specific config for console?

DenisChenu

DenisChenu

2023-09-19 09:31

developer   ~77151

v5: https://github.com/LimeSurvey/LimeSurvey/pull/3454

  1. This issue is ONLY for V6 , and are not related to console
  2. No new issue with console and createPublicUrl if i don't make error.

As this is only required when running ConsoleApplication, maybe there is the need of having specific config for console?

This is a new feature and must be reported separatly.

DenisChenu

DenisChenu

2023-09-19 10:07

developer   ~77152

@juliodiz : i check on last git version : seems OK (via web)

Except it don't use publicurl of config.

DenisChenu

DenisChenu

2023-09-19 10:14

developer   ~77153

@gabrieljenick :

Config section ('publicurl'=>'https://limesurvey.example.org:8000/limesurvey')

You can set whole baseUrl in publicurl : 'publicurl' => 'https://www.example.org/example/' work (in current master too).

gabrieljenik

gabrieljenik

2023-09-19 13:34

manager   ~77163

@DenisChenu

re: https://github.com/LimeSurvey/LimeSurvey/pull/3454#pullrequestreview-1632679815
The issue is said to be in console application, so we ported the URL methods to ConsoleApplication.
Why you say is not related?

Was related to new feature «Survey alias»

I am no that sure.
Issue seems to have started here when model got dependen on the application.
https://github.com/LimeSurvey/LimeSurvey/commit/3c7045423a5918987840f2723d7ca2e7f4097823

gabrieljenik

gabrieljenik

2023-09-19 13:37

manager   ~77164

@mazi @francois-charles.hebert @juliodiz
Maybe you can help testing the PR?

Mazi

Mazi

2023-09-19 13:49

updater   ~77165

@bismark, please have a look and check to what extend this affects our Inviter and Reminder cronjobs.

DenisChenu

DenisChenu

2023-09-19 15:23

developer   ~77170

The issue is said to be in console application, so we ported the URL methods to ConsoleApplication.

Look at the issue

Summary 18961: {SURVEYURL} not complete URL
Description

{SURVEYURL} don't show complete URL

/index.php/215424?token=test1&lang=en-US
Steps To Reproduce
Steps to reproduce

Use {SURVEYURL}
Expected result

https://survey.com/index.php/215424?token=test1&lang=en-US
Actual result

/index.php/215424?token=test1&lang=en-US

Where did you see console application here ?

DenisChenu

DenisChenu

2023-09-19 15:56

developer   ~77171

Issue seems to have started here when model got dependen on the application.

Yes, but why fix it in 5.X then ?
There are another issue to report for console here https://bugs.limesurvey.org/view.php?id=18961#c76235

But only for 6.X

gabrieljenik

gabrieljenik

2023-09-19 16:51

manager   ~77177

Yes, but why fix it in 5.X then ?

It is blocking. If fixes are similar, we cna port one to the other.

DenisChenu

DenisChenu

2023-09-19 17:15

developer   ~77181

Last edited: 2023-09-19 17:16

It is blocking. If fixes are similar, we cna port one to the other.

Oh right : the issue wityh console happen too

Just when call Survey->getSurveyUrl()

@juliodiz : can you confirem something : you report the issue only for console or there are another issue ?

juliodiz

juliodiz

2023-09-20 00:33

reporter   ~77191

{SURVEYURL} i use at email and remember email. When i use sendmailbycron URL was missing. (sendmailcron)

DenisChenu

DenisChenu

2023-09-20 09:02

developer   ~77194

{SURVEYURL} i use at email and remember email. When i use sendmailbycron URL was missing. (sendmailcron)

You deactivate error to have the mail sent ?
Because i have CException: ConsoleApplication and its behaviors do not have a method or closure named "createPublicUrl" and it broke!?

Why you din't report at https://gitlab.com/SondagesPro/mailing/sendMailCron/-/issues ?

DenisChenu

DenisChenu

2023-09-20 09:26

developer   ~77195

Last edited: 2023-09-20 09:39

Checked with no update on sendMail Cron

With https://github.com/LimeSurvey/LimeSurvey/commit/55d9eda4c9407db6982dfad0ae8355dfc3c0d572 (parent of https://github.com/LimeSurvey/LimeSurvey/commit/3c7045423a5918987840f2723d7ca2e7f4097823 ) :

  • OK with only sendMailCron config
tibor.pacalat

tibor.pacalat

2023-09-22 17:58

administrator   ~77287

@gabrieljenik it looks like there is more work to be done here. Any update on this?

DenisChenu

DenisChenu

2023-09-22 19:04

developer   ~77289

@Mazi and @bismark : did you test with your own plugin ?

sendMailCron didn't work, but create a fix is easy.

Issue History

Date Modified Username Field Change
2023-07-18 00:35 juliodiz New Issue
2023-07-18 01:47 juliodiz Note Added: 76116
2023-07-18 01:47 juliodiz Bug heat 0 => 2
2023-07-18 02:23 juliodiz Note Added: 76119
2023-07-18 10:48 ollehar Note Added: 76121
2023-07-18 10:48 ollehar Bug heat 2 => 4
2023-07-18 10:48 ollehar Note Added: 76122
2023-07-18 10:53 ollehar Priority none => high
2023-07-18 11:01 ollehar Note Added: 76123
2023-07-18 11:01 ollehar Assigned To => ollehar
2023-07-18 11:01 ollehar Status new => feedback
2023-07-18 15:26 juliodiz Note Added: 76137
2023-07-18 15:26 juliodiz Status feedback => assigned
2023-07-22 03:54 juliodiz Note Added: 76235
2023-07-24 15:17 juliodiz Note Added: 76243
2023-07-24 17:59 DenisChenu Issue Monitored: DenisChenu
2023-07-24 17:59 DenisChenu Bug heat 4 => 6
2023-07-24 18:00 juliodiz Note Added: 76252
2023-08-15 10:04 guest Bug heat 6 => 12
2023-08-15 10:21 Mazi Note Added: 76589
2023-08-15 10:21 Mazi Bug heat 12 => 20
2023-08-16 11:15 bismark Note Added: 76612
2023-08-16 11:15 bismark Bug heat 20 => 22
2023-08-24 08:32 DenisChenu Note Added: 76692
2023-08-24 08:32 DenisChenu Bug heat 22 => 24
2023-08-24 09:15 Mazi Note Added: 76693
2023-08-24 15:07 guest Bug heat 24 => 30
2023-08-24 15:11 francois-charles.hebert Issue Monitored: francois-charles.hebert
2023-08-24 15:11 francois-charles.hebert Bug heat 30 => 32
2023-08-24 15:49 francois-charles.hebert Note Added: 76695
2023-08-24 15:49 francois-charles.hebert Bug heat 32 => 34
2023-08-24 16:16 DenisChenu Note Added: 76698
2023-09-11 19:52 gabrieljenik Relationship added related to 18960
2023-09-12 08:30 DenisChenu Note Added: 76952
2023-09-12 17:44 gabrieljenik Note Added: 76962
2023-09-12 17:44 gabrieljenik Bug heat 34 => 36
2023-09-12 17:45 DenisChenu Note Added: 76963
2023-09-12 18:50 gabrieljenik Assigned To ollehar => gabrieljenik
2023-09-13 17:12 DenisChenu Note Added: 77014
2023-09-13 17:52 gabrieljenik Note Added: 77015
2023-09-18 14:09 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-09-18 14:09 gabrieljenik Status assigned => ready for code review
2023-09-18 14:09 gabrieljenik Note Added: 77120
2023-09-18 14:09 gabrieljenik Note Edited: 77120
2023-09-19 09:31 DenisChenu Note Added: 77151
2023-09-19 10:07 DenisChenu Note Added: 77152
2023-09-19 10:14 DenisChenu Note Added: 77153
2023-09-19 10:15 DenisChenu Assigned To DenisChenu => gabrieljenik
2023-09-19 10:15 DenisChenu Status ready for code review => in code review
2023-09-19 13:34 gabrieljenik Note Added: 77163
2023-09-19 13:37 gabrieljenik Note Added: 77164
2023-09-19 13:49 Mazi Note Added: 77165
2023-09-19 15:23 DenisChenu Note Added: 77170
2023-09-19 15:56 DenisChenu Note Added: 77171
2023-09-19 16:51 gabrieljenik Note Added: 77177
2023-09-19 17:15 DenisChenu Note Added: 77181
2023-09-19 17:16 DenisChenu Note Edited: 77181
2023-09-20 00:33 juliodiz Note Added: 77191
2023-09-20 09:01 DenisChenu Summary {SURVEYURL} not complete URL => {SURVEYURL} didn't work with plugin using cli event
2023-09-20 09:02 DenisChenu Note Added: 77194
2023-09-20 09:19 DenisChenu Status in code review => ready for testing
2023-09-20 09:26 DenisChenu Note Added: 77195
2023-09-20 09:27 DenisChenu Note Edited: 77195
2023-09-20 09:39 DenisChenu Note Edited: 77195
2023-09-20 14:39 gabrieljenik Assigned To gabrieljenik => tibor.pacalat
2023-09-22 17:57 tibor.pacalat Status ready for testing => feedback
2023-09-22 17:57 tibor.pacalat Assigned To tibor.pacalat => gabrieljenik
2023-09-22 17:58 tibor.pacalat Note Added: 77287
2023-09-22 17:58 tibor.pacalat Bug heat 36 => 38
2023-09-22 19:04 DenisChenu Note Added: 77289