magento unable to reroute to controller in config.xml - magento-1.4

(FYI this is version 1.4, and yes I'm flushing my var/cache folder. I've started reading through Alan Storm's tutorials and that helped, but nothing specific on this problem)
I am new to Magento, we are using the OnePage checkout method, and we have the following:
app/code/local/Ourcompany/Checkout/etc/config.xml
Which has the following definition:
<frontend>
<routers>
<checkout>
<args>
<modules>
<Ourcompany_Checkout before="Mage_Checkout">Ourcompany_Checkout</Ourcompany_Checkout>
</modules>
</args>
</checkout>
</routers>
</frontend>
I have a corresponding file in:
/app/code/local/Ourcompany/Checkout/controllers/OnepageController.php
In there I have a class:
class Ourcompany_Checkout_OnepageController extends Mage_Checkout_OnepageController
So far I have not been able to get Magento to acknowledge it's there. The native methods in core are being called only. If I remove or rename this page, there is no error statement - I think my syntax in config.xml is not correct. Can anyone identify the improper syntax present?

This is the first time I have answered my own question but I think the answer here is noteworthy. The CommerceBug debugger was very useful as I was able to look at classes that were loaded. As it turns out, there was another module that had been created, called Admaster which got precedence as the router for the OnepageController.
I'm sure dealing with this type of conflict is common for Magento, so I have a mental checklist item now if this happens again.

Related

zend framework 2 : A plugin by the name "getServiceLocator" was not found

I am new to ZF2.
Today I was trying to implement a simple database operation. I was referring to https://framework.zend.com/manual/2.4/en/user-guide/database-and-models.html.
But I am getting following error
A plugin by the name "getServiceLocator" was not found in the plugin manager Zend\Mvc\Controller\PluginManager
What am I missing ?
Just a note: ZF2 is warning since a long time now about the depreciation of the use of $this->getServiceLocator() in the code and so we should respect it.
But still some of us have projects already developed with old code and we can't change all that now so had to find this solution.
Try adding "zendframework/zend-mvc": "2.6.3" to the composer.json file under require list like the following:
"require": {
....
"zendframework/zendframework": "~2.5",
"zendframework/zend-mvc": "2.6.3",
....
}
This will allow you to make use of the $this->getServiceLocator() in the controller.
What this does is - even if the framework version gets on updating, the zend-mvc will always remain old in you code and support the use of $this->getServiceLocator().
I know that most of them won't like this usage but it will definitly helps those who have got no way to upgrade/modify their code.
I hope it helps someone.

Access to Resources resx file failing. (MVC & ErrorMessageResourceType)

Been troubling me for hours this! As a newbie to MVC, have followed various ways of trying to access a resource file in the App_GlobalRecources folder.
The RESX file properties are Embedded Resource as build action, and custom tool is set to PublicResXFileCodeGenerator.
I also have this in the web.config (system.web):
<globalization enableClientBasedCulture="true" culture="auto" uiCulture="auto" />
In a view model, (although have tried accessing from functions with the same problem), I have the following:
Public Class ExternalLoginConfirmationViewModel
<Required(ErrorMessageResourceType:=TypeOf (Resource1), ErrorMessageResourceName:="Test")>
<Display(Name:="Email")>
Public Property Email As String
End Class
The problem is that I get the following error:
'Resource1' is a class type and cannot be used as an expression.
I cannot figure out why as have tried numerous suggestions from numerous websites, and get the same error.
OK - so seemed to have solved it.
Every website I have found advises the VB below (or the C# equivalent):
<Required(ErrorMessageResourceType:=TypeOf (Resource1), ErrorMessageResourceName:="Test")>
Not one website has suggested this which seems to have solved the problem, although I don't know why:
<Required(ErrorMessageResourceType:=GetType(Resource1), ErrorMessageResourceName:="Test")>
Anyway, hope this helps if someone else has the same issue.

Grails internationaliization with custom bundles

My Grails (2.4.2) app was created with a bunch of "default/standard" resource bundles:
myapp/
grails-app/
i18n/
messages.properties
messages_fr.properties
I would now like to create my own "custom" resource bundle, that is, define properties in a file outside of these standard messages*.properties files that myapp was created with.
According to the i18n documentation, all bundles need to be prefixed with messages and suffixed .properties. So I added two new props files, one for English and one for French:
myapp/
grails-app/
i18n/
messages.properties
messages_fr.properties
messages_myapp.properties
messages_myapp_fr.properties
For one, I'm not 100% sure I'm interpreting the docs correctly. So if anything about my 2 new props files jumps out at you as being incorrect, please start by letting me know!
Having said that, in all the example from those docs, I don't see where you specify the bundle to use. All of the examples look like this:
<g:message code="fizz.buzz.foo" />
But what if I have a fizz.buzz.foo property defined in both messages_blah.properties and messages_bar.properties?
So I ask: How do I add my own custom resource bundles, and how do I properly refer to them from inside a GSP?
To answer your question you have to understand what Grails (well, Spring really) is doing to accomplish this.
You are on the right path with the multiple files. What you have outlined there matches the documentation and will work.
However, under the covers what is really being done is they are being combined into a single bundle (per language). So there is no need to tell Grails/Spring which bundle to use.
Finally, what happens when the same key is defined multiple times? The first one matched wins. I seem to recall that the order in which the bundles are combined is in file name order, though you should be able to test this pretty quickly.
Hope this helps, and best of luck!

How to add custom fields in ZFC-user module for zend 2 without doctrine?

I have tried using creating a different module and attaching the ZfcUser\Form\Register over init method. But it wasn't working.
I want to add few custom fields, with changing any thing in the vendor dir, as is it not a good practice. I also tried using user_entity_class ,creating a custom 'User' class, but it was creating some route issue in other modules, with zfc-user , I'm also using zfc-admin and zfc-adminuser, the error was coming in zfc-adminuser, Couldn't found the class was the error.
Thanks in advance.
Well there are some issue regarding the overriding of the module ZFC-User, But still you can overwrite it manually.
One way I have used is a bit old fashioned but working. What I have done is I have copied complete module the to module folder. Then pointing the form towards to my module where the changes are required, rest all are pointed to default.With this you can update your module. Make sure you point the user_entity_class to your module something like this:
'user_entity_class' => 'MyZfcUser\Entity\User',
you can find this in config\autoload\zfcuser.global.php

Attributes from MvxBindingAttributes are not added with MvvmCross

I have the MvxBindingAttributes.xml in my UI.Droid/Resources/Values but everytime I try to use the bindings in my layouts I get
Warning attribute is not declared.
No resource identifier found for attribute 'MvxBind' in package
'DroidUI'
so for some reason it cannot find those attributes. I have tried to close/reopen/clean/rebuild with no luck, tried removing the layouts and then building (Hoping it would add them at build) and then try to add them again, but nothing seems to work
Have you checked that the MvxBindingAttributes.xml file is marked in properties as an AndroidResource?
VisualStudio likes marking the xml files as content or none instead - especially if you've added the MvxBindingAttributes.xml file as a link.
As an update to this, you can also now use a special 'auto' xml scheme:
xmlns:local="http://schemas.android.com/apk/res-auto"
In the project properties, add a Android Manifest file and add a package name that contains at least two periods, for example:
com.DroidUI
In the axml file, type the package name instead of the namespace:
xmlns:local="http://schemas.android.com/apk/res/com.DroidUI
xmlns:local="http://schemas.android.com/apk/res-auto
Fixed it for me.
First, thanks for the answer. I had the same problem.
But in my case, attempting to use the suggestions above failed. or at least that is what i thought.
When i used local:MvxItemTemplate=#layout/My_Manifest while i had the My_Manifest.axml file correctly placed in Layout folder, and correct xml schemas, it still had problems.
But, when i changed My_Manifest to my_manifest while leaving the actual file name as My_Manifest.axml, everything was working.
just wanted to share
In my case for some reason the MvxBindingAttributes.xml file existed, but hadn't been included in the project. Right-clicking on MvxBindingAttributes.xml and choosing "Include in Project" sorted the problem for me.
Just in case: You might also have rubbish (in my case, it were dots) in some of your XML. But the error pointed "Maybe there's something wrong with the auto-generated XML lol" so it took me half an hour to notice it... Sigh!

Resources