PyroCMS accessing a module controller inside system routes file - codeigniter

I tried accessing a module controller in the $route['default_controller'] setting in routes.php but I'm getting the following error:
I have been getting this error a lot lately and don't understand entirely what exactly it means. Does anybody know what I'm doing wrong? Below is my routes statement:
$route['default_controller'] = 'contractors/routes/mainDisplay';

The error is about the language file not the routing. Apparently you have loaded a lang file in you module but pyrocms can't find the file. make sure that the language file is placed correctly and check the filename which should be contractors_lang.php.
do you have this file?
../modules/contractors/language/english/contractors_lang.php
if not, make one.

Related

Find exact value of VUE_APP_API_BASE_URL for laravel project

I have a laravel + Vue.js project template downloaded from Creative Tim. Its login and register is not proceeding, giving the catch error whereas in the template demo its working fine. I think so the instructions said to write the VUE_APP_API_BASE_URL in Vue .env file and I didn't wrote it correct. Can anyone pls tell me how can I locate the exact address and what syntax it would be?
Since you are using vue with laravel, you need to prefix MIX_ before the variable. Eg:
MIX_VUE_APP_API_BASE_URL=http://localhost:8000
Here is the reference: https://laravel.com/docs/8.x/mix#environment-variables

Unable to load your default controller Please make sure the controller specified in your Routes.php file is valid

I use HMVC and I uploaded my site from local to online.
I have a strange error:
Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.
on my local server works fine! So sad! I changed only base_url and database details. I shouldn't have this error...

problem changing domain name to Ruby application

I changed the domain name for my ruby application but when I run it I get
The page you were looking for doesn't exist.
In the log file it says
Routing error no route matches [GET] "/"
In my routing file config/routes.rb I changed domaincontraint to domain new.
I must say that this configuration worked with my old domain name.
Am I missing some place to change the domain name? Please note I am very noobie to ruby
So, the good news is you are getting Routing error no route matches [GET] "/". this means your request reaches the rails application. Because in most cases it doesn't even come pass your server such as Nginx. In such cases its nothing to do with rails.
However, since you get the above routing error, that means your request hits the rails app.
Few things to check here:
1) make sure you have a root url defined in your config/routes file.
2) Make sure you url you are trying to access has a matching route.
For an example, say if you do http://<your domain>/products
Then in the routes, you should have products GET /products(.:format) products#index
You can check this by running rake routes from root of your rails app.
Also, it will be helpful for you to update the question with your config/routes file and also the url you are trying to access.

Named Routes Not Recognised in Method When Called From PHPUnit Test

When calling a Method from another class that contains a named route the route is not recognised
This PHPUnit test is to check that functionality of the system still meets requirements as the system is complicated.
Testing is run from a local environment (homestead vagrant)
I am calling the method form here:
$orderLines = (new EDIProcessController())->getChanges($order['ediOrder'], $order['partnerId']);
And the named route that is causing the issue:
$orderLine->item_url = route('warehouse.products.view', $itemDetails->id);
I get the following error:
InvalidArgumentException: Route [warehouse.products.view] not defined.
/home/vagrant/vr/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:305
/home/vagrant/vr/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:790
/home/vagrant/vr/app/Http/Controllers/Warehouse/EDI/SPS/EDIProcessController.php:1575
/home/vagrant/vr/vendor/laravel/framework/src/Illuminate/Support/Collection.php:861
/home/vagrant/vr/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php:139
/home/vagrant/vr/app/Http/Controllers/Warehouse/EDI/SPS/EDIProcessController.php:1746
Route as defined in the routes file:
Route::get('/view/{id}', 'Warehouse\ProductController#viewProduct')->name('warehouse.products.view');
This route works fine when called from within Laravel app but will not work within PHPUnit test
Finally found the answer
There is a issue with using require_once for sub route files that is caused due to multiple instances of route files not all getting the required files.
Here is a dicussion here that I eventually found
switching the require_once to require at all levels of our route files solves the issue

404 Error in Magento extension when deployed in production

This one is puzzling me for 2 days now. I've found a solution for a 404 in admin, but it is not the same that is happening here. I have exactly the same version of Magento in my local copy and production server: 1.7.0.2. The extension works great in local. I packaged it using Magento Connect and installed in production the same way. All files are there. It shows in the menu and in Configuration section, but when I click the menu to go to the report, I get the beloved 404. I loged out and in, flushed cache zillion times (including deleting the files manually) but nothing changed.This are the URLs in both envs:
(Dev)http://localhost/magentos/index.php/salestaxes/adminhtml_salestaxes/index/key/c4b8ecb58fa2062f696cacfd340/
(Prod)https://www.myserver.com/index.php/salestaxes/adminhtml_salestaxes/index/key/332e617e74a92a39a40cf5d3/
As you can see is exactly the same. I don't know wahy then I'm getting the error. Can somebody point what can I do to solve this? DO I need to check any setting? What can cause this?
This is a var_dump that I get in the router _validateControllerClassName() method:
string(115) "/home_path/public_html/app/code/community/Surpassweb/SalesTaxes/controllers/Adminhtml/SalestaxesController.php"
string(100) "/home_path/public_html/app/code/community/Surpassweb/SalesTaxes/controllers/IndexController.php"
This is the output of Alam's 404 module:
Controller Name
Controller Name: adminhtml_salestaxes
The controller name adminhtml_salestaxes matches the following controller file, but this file does not exist.
home_path/public_html/app/code/community/MyCompany/SalesTaxes/controllers/Adminhtml/SalestaxesController.php
The file is there and has 755 permissions.
This is the first line in may controller:
class MyCompany_SalesTaxes_Adminhtml_SalesTaxesController extends Mage_Adminhtml_Controller_Action {
Thanks for your time.
Are you absolutely sure the file is there? Named the same? With the same character capitalization? And that you're not in a production setup with multiple frontend webservers?
If you'll indulge me — copy the path of the controller from the Better 404 page to your computer's clipboard. Then type
$ ls -l [PASTE]
into your terminal window. My bet if the file won't be there. Also try
$ls -l app/code/community/Surpassweb/SalesTaxes/controllers/Adminhtml/
to see what files are there.
Looking at the information you provided, Magento is looking for a file named
app/code/community/MyCompany/SalesTaxes/controllers/Adminhtml/SalestaxesController.php
I don't know what your actual file is named, but looking at the class name
MyCompany_SalesTaxes_Adminhtml_SalesTaxesController
leads me to believe it might be incorrectly named SalesTaxesControlle.php. Notice the T in sales taxes is capitalized, vs the lowercase t Magento is looking for.
For some reason magento isn't registering the route to your app.
Either apache doesn't know to let magento handle it or magento doesn't know what to do with it.
Check your htaccess files and virtual host configs for the two environments.
Right off the bat I can see they're not exactly the same. One is http and one is https.
Those are probably two different virtual host configs and could be slightly different.
Next I would make sure the config xml for your module is included in magento/app/etc/modules/ folder. Make sure the module is enabled. There should be a line for that in your modules config xml file.
If you deployed it to the local vs community folder, check the magento/app/etc/local.xml and make sure disable_local_modules is set to no.
Good luck. Troubleshooting in live is always fun.

Resources