magento/magento2 — pull request #267 by mrploddy (2013-03-22 15:45:34+00:00)
Title: Issue with camel case in cusutom defined source models

If you are writing your own module which has got a camel case in the directory name this won't let you define your own source model because the RegEx prevents the camel case. Eg
Juicymedia_Modulehere_Source_Myoptions = OK
JuicyMedia_Modulehere_Source_Myoptions = Not OK due to regex

For example the following system.xml generates ->

Credit Card Types
JuicyMedia_Sagepayform_Model_Source_ModeAction

Gives the following error - >

a:5:{i:0;s:800:"Invalid XML in file /home/mage2craig/public_html/app/code/local/JuicyMedia/Sagepayform/etc/adminhtml/system.xml:
Element 'source_model': [facet 'pattern'] The value 'JuicyMedia_Sagepayform_Model_Source_ModeAction' is not accepted by the pattern '[A-Z]+[a-z0-9]{1,}(_[A-Z][A-Z0-9a-z]+){1,}(::[A-Z0-9a-z_]+)?'.
Line: 18

Element 'source_model': 'JuicyMedia_Sagepayform_Model_Source_ModeAction' is not a valid value of the atomic type 'typeModel'.
Line: 18

Element 'source_model': [facet 'pattern'] The value 'JuicyMedia_Sagepayform_Model_Source_ModeAction' is not accepted by the pattern '[A-Z]+[a-z0-9]{1,}(_[A-Z][A-Z0-9a-z]+){1,}(::[A-Z0-9a-z_]+)?'.
Line: 56

Element 'source_model': 'JuicyMedia_Sagepayform_Model_Source_ModeAction' is not a valid value of the atomic type 'typeModel'.
Line: 56

The small addition as specified in this pull request should fix that issue.