Inflection Problem with word "Analyses"... expects model "AnalyAsis"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inflection Problem with word "Analyses"... expects model "AnalyAsis"

NOSLOW

Please excuse me if I missing something stupid here, but being new to
Cake, I'm having trouble getting started with the MVC files for a
"Sales Analysis" model.  I've struggled a great deal with this trying
numerous things and still remain stumped.  To be clear, "Analyses" is
the plural of "Analysis"

The simplest way I can describe this is to list the basic steps
followed that leads to the problem. My approach is to let Cake tell me
how to proceed by following the error message instructions:

1. navigate to desired URL: http://localhost/cakeroot/sales_analyses/.
Error message indicates "Missing controller...  SalesAnalysesController
could not be found..." and instructs me to create one "in file :
app\controllers\sales_analyses_controller.php". So far, so good.

2. Create controller file according to error message in step 1, and
refresh page to get new error message: "Missing Model...No class found
for the model SalesAnalyAsis..." and instructs me to create one "in
file : app\models\sales_analy_asis.php". Not so good!

As you can see, it's expecting the model "SalesAnalyAsis" instead of
the desired "SalesAnalysis".  Do I need to customize my Inflections.php
file to make this work or is this a bug that should be addressed? I'm
using version 1.1.10.3825.

Thanks


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Inflection Problem with word "Analyses"... expects model "AnalyAsis"

Meek-2

Do I need to customize my Inflections.php
> file to make this work or is this a bug that should be addressed? I'm
> using version 1.1.10.3825.
>
> Thanks

I got the same result. The following in /app/config/inflections.php
solved it:
$irregularPlural = array('salesanalysis' => 'salesanalyses');
I guess the inflection rules are never going to be perfect, but it
looks like cake does try to address this kind of pluralisation in
inflector.php 179-180:

'/(^analy)ses$/i' => '\1sis',
'/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' =>
'\1\2sis',

so I would say it is something which should be reported and looked at.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Inflection Problem with word "Analyses"... expects model "AnalyAsis"

NOSLOW

That kinda works, but will that cause problems later on because the
CamelCase is not correct?

It's reporting: "Missing Model...No class found for the model
Salesanalysis...in file : app\models\salesanalysis.php".

I'm concerned that the model filename is "salesanalysis" instead of the
expected "sales_analysis.php".

For now I'll play it safe with just plain "analysis".

meek wrote:
> I got the same result. The following in /app/config/inflections.php
> solved it:
> $irregularPlural = array('salesanalysis' => 'salesanalyses');


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---