Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:03:38+00:00 2026-06-03T08:03:38+00:00

I have some actions defined like action = ‘[module]/[action]’ & submit. The result is

  • 0

I have some actions defined like “action = ‘[module]/[action]'” & submit.
The result is ‘[currentUrl]/[module]/[action]’ instead of ‘[module]/[action]’, I can’t figure out why, here’s the code :

On the front :

<a href="<?php echo ( isset($disabledMajSuivi) && $disabledMajSuivi ? "#" : "javascript:showYesNoDialog('". addslashes(__('enquete.visu.msg.confirmation.majsuivi')). "', 'majSuivi')" ); ?>" >
    <?php echo __('enquete.visu.majsuivi');?>
</a>

showYesNoDialog is a javascript function where first arg is the sentence displayed and second arg is callback function, so ‘majSuivi’ is called back and looks like this :

<script>
function majSuivi(response) {
    if(response == 'yes') {
        document.forms[0].action = "module_name/majsuivi";
        document.forms[0].submit();
    }
}

This has been debugged, the condition is true.

The action ‘majSuivi’ (that is big) ends like this :

    $this->redirect('enquete/visu?enq_id='.$enq_id
        . (!is_null($personneMorale) ? '&pm_id='.$personneMorale->getPmId() : '') );

But no action is executed because of the wrong url (so actualy this part of code is kind of useless).

So when the URL should be : http://[baseUrl]/index.php/module_name/majsuivi

It is instead : http://[baseUrl]/index.php/enquete/visu/enq_id/24/menu_id/module_name/majsuivi
Where /index.php/enquete/visu/enq_id/24/menu_id/ was the current url just before calling ‘majSuivi action.
Each time I click on the “a href” button, it adds the “module_name” to the URL like following :

click -> http://[baseUrl]/index.php/enquete/visu/enq_id/24/menu_id/module_name/majsuivi

click2 -> http://[baseUrl]/index.php/enquete/visu/enq_id/24/menu_id/module_name/module_name/majsuivi

click3 -> http://[baseUrl]/index.php/enquete/visu/enq_id/24/menu_id/module_name/module_name/module_name/majsuivi

etc …

I don’t think it comes from the routing.yml config file, but if someone thinks it could, I’ll write the content of it.

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:03:39+00:00Added an answer on June 3, 2026 at 8:03 am

    You should use something like this:

    document.forms[0].action = "<?php echo url_for('module_name/majsuivi')?>";
    

    or

    document.forms[0].action = "/index.php/module_name/majsuivi";
    

    or if you have this route in your routing.yml

    document.forms[0].action = "<?php echo url_for('@your_route_name_from_yaml')?>";
    

    Because 'module_name/majsuivi' is a relative path and will be concatenated with your current url without / at the beginning

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my default route defined like this routes.MapRoute( Default, // Route name {controller}/{action}/{id},
I have one route defined in application.ini like router.routes.xx.route = y/:var/:controller/:action/* router.routes.xx.defaults.controller = page
I have some not understanding actions from gnu clisp Suppose, I have some code
I have a class that I need to perform some actions on but I
I have an issue with System.Threading.Timer. I am scheduling some actions using a time
I currently have some action associated with when the user types something in a
I have a code generating a timespan to calculate a duration of some action.
I have to implement a few action. Each of they have some common elements,
I am working on struts2. In my action class I have written some accessors
I have an action method that depending on some conditions needs to return a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.