Streams with multiple words in name throw errors.Created 5 years ago by gonziis
Hey, I have a problem with my addon. I have multiple streams in my addon some have multiple words like DecisionTypeCategories etc. It installed without any errors, but when I go in CMS and try to access any links containg the name it throws
Class 'Anomaly\Streams\Platform\Model\Lemumi\LemumiDecisionTypeCategoriesEntryModel' not found
Other streams that have only one name work. What am I missing here?
Also when I try to /create the base stream which has a relationship with one of those with multiple words, it throws
Class CaseClassificationModel does not exist. Like there isn't even a model created for those streams with multiple words.
Go through and check your bindings and model
extends parts of the class in your addon. Looks like either it's not autoloading correctly OR the names were wrong / changed and aren't matching up any more. If you have an IDE it should hint and tell you "Yo.. these classes do not exist!" so to speak. We'll go from there.
Ok, I found something. In
storage/streams/default/models/ directory I found the entry model file. The error says
Class 'Anomaly\Streams\Platform\Model\Lemumi\LemumiDecisionTypeCategoriesEntryModel' not found but the class and the file in
storage directory is
LemumiDecisiontypecategoriesEntryModel. Could there be a problem?
Ok, this definetly seems as a bug. The addon file generated the classes extending names with capitalized first words, but the actual files in storage are lower cased. I changed the classes in addons to extend and use class with lowercase letters and it works now. Seems like it should be working automatically.
I had this problem once, when you are created your stream you probably used camelCase or StudlyCase? But you need to use snake_case.