Jump to content

"No route passed" [solved]


mischka

Recommended Posts

Hello guys,

Yes, this is another one in the category "no route passed" :(

I've searched this forum extensively and haven't come up with any solution. There's a couple of jscript references on top of my layout.tpl but that's in the right place, and the htmlhead includes on php as well.

Seeing that there are so many errors on this I'm coming to think this is just bad coding. I'd fix it myself but can't find where is the class "addbid" that takes care of this stuff. I don't see why this should be some fancy javascript, cause all it does is add the id of the bidding pilot into the record for that schedule?

I'm sure if I'd figure out a non-javascript way to ad a bidd then a lot of people's lives would be better, so if anyone can help with suggestions where to start?

Link to comment
Share on other sites

  • Moderators

I think that a temporary solution would be just to refresh the page. Also, i've seen that the Schedules page gives me this error when the page has not completely loaded.

Check it and i'll give it a try to find if there is a solution into the forum.

Link to comment
Share on other sites

thank you, but unfortunately this is not the solution to my problem. I don't have these scripts that are mentioned in the posts, and i downloaded the latest version of phpvms a few days ago. There isn't any reference to jscripts in my layout.tpl except some in /lib/js as it should be.

I had this problem last year with IE6 on one pc, which I think I remedied it with upgrading to IE7. So it's not really an issue with my website per say, as just an incompatability issue between phpvms and some/all browsers.

In the meantime I found the addbid class in /modules/schedules/schedules.php

this is how the class is called in schedule_results.tpl

<a id="<?php echo $route->id; ?>" class="addbid"
 href="<?php echo url('/schedules/addbid');?>">Add to Bid</a>

and this is the interesting part of addbid:

public function addbid()
{
 if(!Auth::LoggedIn()) return;

 $routeid = $this->get->id;

 if($routeid == '')
 {
  echo 'No route passed';
  return;
 }

obviously my routeid doesn't get passed due to some javascript issue.

wouldn't it be possible to change the addbid procedure to something like

public function addbid(routeid)

and then call it directly by the url rather than passing a separate id="xxx" ? ie schedules/addbid?routeid=1 or something?

I don't normally use php/java but that's how I would do it in asp for example.

On another note: I use some different stylesheet than in crystal, could that mess things up?

Link to comment
Share on other sites

Right, I solved it myself after all!

Here is what I did, and how I came to the solution: I noticed that the pilot brief page also worked with the route id, and this worked. The diference was that the link to the pilot brief page was coded like this:

<a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br />

and the addbidd link was coded like this:

<a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a>

What happened was that on the 2nd piece of code the route-id wasn't passed, so obviosly I got the wellknown error message.

So, what I did was change it to the following:

<a href="<?php echo url('/schedules/addbid/'.$route->id);?>">Add to bid (new)</a><br />

This neatly passed my route-id to the addbidd procedure, but that needs to be changed to "understand" the new input, so here it is:

public function addbid($routeid = '')
{
if(!Auth::LoggedIn()) return;

/* $routeid = $this->get->id; */

I simply added the $routeid="" to the header, which passes the route. Note how I commented out the red section: if you don't do this it will overwrite the routeid variable again.

This works perfectly for me now! Got to do the same thing for removing a bidd - might post that later if anyone is interested.

If anyone has reasons why this should not be done like this I'm happy to hear!

Edited by servetas
added the code in [code] brackets
Link to comment
Share on other sites

Right, I solved it myself after all!

Here is what I did, and how I came to the solution: I noticed that the pilot brief page also worked with the route id, and this worked. The diference was that the link to the pilot brief page was coded like this:

<a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br />

and the addbidd link was coded like this:

<a id="<?php echo $route->id; ?>" class="addbid"

href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a>

What happened was that on the 2nd piece of code the route-id wasn't passed, so obviosly I got the wellknown error message.

So, what I did was change it to the following:

<a href="<?php echo url('/schedules/addbid/'.$route->id);?>">Add to bid (new)</a><br />

This neatly passed my route-id to the addbidd procedure, but that needs to be changed to "understand" the new input, so here it is:

public function addbid($routeid = '')

{

if(!Auth::LoggedIn()) return;

/* $routeid = $this->get->id; */

I simply added the $routeid="" to the header, which passes the route. Note how I commented out the red section: if you don't do this it will overwrite the routeid variable again.

This works perfectly for me now! Got to do the same thing for removing a bidd - might post that later if anyone is interested.

If anyone has reasons why this should not be done like this I'm happy to hear!

Hello I wonder if it is possible to provide the code for me because I'm not getting to do what was explained! Thank you!

Link to comment
Share on other sites

  • 6 months later...

Right, I solved it myself after all!

Here is what I did, and how I came to the solution: I noticed that the pilot brief page also worked with the route id, and this worked. The diference was that the link to the pilot brief page was coded like this:

<a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br />

and the addbidd link was coded like this:

<a id="<?php echo $route->id; ?>" class="addbid"

href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a>

What happened was that on the 2nd piece of code the route-id wasn't passed, so obviosly I got the wellknown error message.

So, what I did was change it to the following:

<a href="<?php echo url('/schedules/addbid/'.$route->id);?>">Add to bid (new)</a><br />

This neatly passed my route-id to the addbidd procedure, but that needs to be changed to "understand" the new input, so here it is:

public function addbid($routeid = '')

{

if(!Auth::LoggedIn()) return;

/* $routeid = $this->get->id; */

I simply added the $routeid="" to the header, which passes the route. Note how I commented out the red section: if you don't do this it will overwrite the routeid variable again.

This works perfectly for me now! Got to do the same thing for removing a bidd - might post that later if anyone is interested.

If anyone has reasons why this should not be done like this I'm happy to hear!

Thank you very much. Fixed my problem. jQuery and bids now working!

Link to comment
Share on other sites

  • 2 years later...
  • 10 months later...

Just fix the problem. You most likley have more than one frefrence to the jQiery library. Check layout.php and core_htmlhead.php/ Remove one!

I dont have much information about HTML coding. Can you help me out to eliminate the multiple Jqueiry Library? I am posting codes below.

core_htmlhead.php

<script type="text/javascript">
var baseurl = "<?php echo SITE_URL;?>";
</script>
<link rel="stylesheet" media="all" type="text/css" href="<?php echo fileurl('lib/css/phpvms.css')?>" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Config::Get('PAGE_ENCODING');?>" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAOwtULH3hIBFBwop55kEiVUXnHPT1nKmw&callback=initMap"></script>
<script type="text/javascript" src="<?php echo fileurl('lib/js/jquery.form.js');?>"></script>
<script type="text/javascript" src="<?php echo fileurl('lib/js/phpvms.js');?>"></script>

<?php
echo $MODULE_HEAD_INC;

Layout.php

<!DOCTYPE html>
<html>
   <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Chrome, Firefox OS, Opera and Vivaldi -->
    <meta name="theme-color" content="#367FA9">
    <!-- Windows Phone -->
    <meta name="msapplication-navbutton-color" content="#367FA9">
    <!-- iOS Safari -->
    <meta name="apple-mobile-web-app-status-bar-style" content="#367FA9">

    <!-- <title><?php echo $page_title; ?></title> -->
    <title><?php echo SITE_NAME; ?> CrewCenter</title>

    <?php echo $page_htmlhead; ?>

    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
	   folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/iCheck/flat/blue.css">
    <!-- Morris chart -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/daterangepicker/daterangepicker.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

   </head>
   <body>
    <?php echo $page_htmlreq; ?>

    <div id="content">
	    <?php echo $page_content; ?>
    </div>

    <!-- jQuery 2.2.3 -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
	    $.widget.bridge('uibutton', $.ui.button);
    </script>
    <!-- Bootstrap 3.3.6 -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/bootstrap/js/bootstrap.min.js"></script>
    <!-- Morris.js charts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/morris/morris.min.js"></script>
    <!-- Sparkline -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/sparkline/jquery.sparkline.min.js"></script>
    <!-- jvectormap -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/knob/jquery.knob.js"></script>
    <!-- daterangepicker -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/daterangepicker/daterangepicker.js"></script>
    <!-- datepicker -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/datepicker/bootstrap-datepicker.js"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
    <!-- Slimscroll -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/fastclick/fastclick.js"></script>
    <!-- AdminLTE App -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/dist/js/app.min.js"></script>
    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/dist/js/pages/dashboard.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo SITE_URL?>/lib/skins/crewcenter/dist/js/demo.js"></script>
   </body>

Link to comment
Share on other sites

Try removing this line

<script src="<?php echo SITE_URL?>/lib/skins/crewcenter/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>

under the <!-- jvectormap --> tag in layout,php

Still its showing No Route Passed.

If you want you can use the test account

Edited by shrikar
Link to comment
Share on other sites

You have several errors. One of them may be causing it.

InvalidValueError: initMap is not a function(unknown)
TypeError: $.fn.vectorMap is not a function
[Learn More]jquery-jvectormap-world-mill-en.js:1:1
TypeError: $(...).ajaxForm is not a function
[Learn More]phpvms.js:27:2
TypeError: $(...).vectorMap is not a function
[Learn More]dashboard.js:66:3

Link to comment
Share on other sites

You have several errors. One of them may be causing it.

InvalidValueError: initMap is not a function(unknown)
TypeError: $.fn.vectorMap is not a function
[Learn More]jquery-jvectormap-world-mill-en.js:1:1
TypeError: $(...).ajaxForm is not a function
[Learn More]phpvms.js:27:2
TypeError: $(...).vectorMap is not a function
[Learn More]dashboard.js:66:3

I removed all JS lines from layout.php but still no luck. I have decided to focus on something else for now. I have wasted a lot of time behind this and everything is going futile.

Thanks for your kind help.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...