Skip to main content

#97 Redirection link after edit contest in front-end

Posted in ‘NorrCompetition’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information (available for public)

PHP version
7.4

Latest post by webquality on Tuesday, 19 March 2024 18:16 EET

webquality

Good morning,

Via the front-end:

When you modify a competition and confirm or cancel, you return to the existing competitions page.
The problem is that the user who modifies his competition must not have access to or see the other existing competitions.

How can I remove this redirection or ensure that, once modified, it returns to the competition page that it was modifying?

Thank you so much.

b2z

Hi Julien.

Currently Cancel action is hard coded into the controller code. It is quite tricky, because Cancel action can be made from the two different forms - new competition form and existing competition form. What to do, when you Cancel from new competition form? Where to return?

Save action is also hard coded into the controller code. But in this case you can create a plugin for "onSaveRedirect" event and control with it the redirect URL. See https://docs.norrnext.com/norrcompetition/customisation/events/other#onsaveredirect

I think that there is no problem for us to add a new event for Cancel action also.

Also we can try to implement something like Return Page (this what standard Joomla components have). It is a hidden "return_page" field in the layout that controls where to redirect after the action. Probably it will be enough.

Kind regards,

Dmitrijs

webquality

My goal is to have several people in several different markets, therefore several user accounts that can have competition, but only one that I would have created before.

But I don't want them to be able to see the other competitions that are taking place.

I have already succeeded in part with the ACLs etc for everything separately, but I saw this little return link which referred to the list of categories where they see the other competitions.

I try to ensure that each user with rights to a competition cannot see anything from other competitions that does not belong to them.

That they only have access to a single competition that I would have previously created, that they can only download the photos of their competition after the market and that they can delete all the entries of their competition after the market to let it be reset to zero again.

I hope I can explain it and the translation isn't too bad ;)

b2z

Cancel action can be made from the two different forms - new competition form and existing competition form. What to do when you Cancel from new competition form? Where to return?

Kind regards,

Dmitrijs

webquality

Just return on the page of the contest.

Not on the page of all contest.

 

https://postimg.cc/XB9bJL1p

 

For the moment if the competition modification is saved or canceled it returns to the existing page of all competitions.

This is what I want to avoid so that we don't see competitions that don't belong to the user.

 

https://postimg.cc/Wdz5wngK

 

b2z

I have made improvement in the code to return to competition instead of list of competitions.

But. If it is a NEW contest form and it is being cancelled the return will be to the list of competitions. That is because the contest does not exist.

Kind regards,

Dmitrijs

webquality

I have to download the component again and install it again?

b2z

You should wait for 2.0.5. That version will also contain the improvements to support upcoming Image Moderation Plugin.

Kind regards,

Dmitrijs

webquality

ok cool ;)

 

I continue to test for adapt your component for my project :)

Support information

Support hours: You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+3), but not limited. Our staff is pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days.


Our time: / Your time:

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. We also ask you to remove temporary credentials at your site after the problem is resolved. Thank you.

Support of free extensions is not provided on this forum. Please submit your questions or report issues via Github tracker. See link on the product page.