Re: Can't get Plugin model to work / be noticed at all
My bet is that you don't have a plugin defined somewhere. I had the same problem in a couple of places after the upgrade because I had forgotten to name which plugin the model could be found in. belongsTo = array( className = [PLUGIN].[MODEL] instead of... belongsTo = array( className = [MODEL] And this goes for all relationships, and you might have just missed one. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
Maybe if you paste your AppController, models and controllers code related to Event model and associated models? You can remove irrelevant methods etc. http://bin.cakephp.org -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
hmm, its broken again this morning. Cache fully switched off. issue unresolved. here are the paths its looking in (App::path('Model', 'Calendar')): [0] => /Users/willbarker/Dropbox/tractor2/app/Plugin/Calendar/ Model/ [1] => /Users/willbarker/Dropbox/tractor2/app/Plugin/Calendar/ models/ [2] => /Users/willbarker/Dropbox/tractor2/app/Plugin/Calendar/Lib/ Model/ and my Event model is in Calendar/Model, feeling lonely and ignored. doing this: if ($className == 'Event'){ echo $className.""; print_r($paths); echo ""; } in App.php in the core, I get a different result: Array ( [0] => /Users/willbarker/Dropbox/tractor2/Tractor/Model/ [1] => /Users/willbarker/Dropbox/tractor2/app/Model/ [2] => /Users/willbarker/Dropbox/tractor2/app/models/ ) it dosn't seem to know im wanting the plugin model On Oct 22, 3:41 pm, José Lorenzo wrote: > Well, it happens because in certain pages you visit some classes are loaded > and in other pages it could load different ones. The cache will be written > (appending new classes) every time, but in debug mode it gets cleaned after > a short period, hence the erratic behavior of sometimes being able to load > the class and some others not. > > I'm glad that resolved the issue :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
Well, it happens because in certain pages you visit some classes are loaded and in other pages it could load different ones. The cache will be written (appending new classes) every time, but in debug mode it gets cleaned after a short period, hence the erratic behavior of sometimes being able to load the class and some others not. I'm glad that resolved the issue :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
Thanks Jose, that cleared it out and everything was working again last night, but this morning it had forgotten again and wasn't using the model. I cleared out the cake cache and it used the model. No doubt it will forget again soon. What could be causing this? Its like it sometimes writes something wrong to the cache and then gets stuck on that. On Oct 21, 5:28 pm, José Lorenzo wrote: > App::uses('CalendarAppModel', 'Calendar.Model') in each model in your plugin > should do the trick :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
App::uses('CalendarAppModel', 'Calendar.Model') in each model in your plugin should do the trick :) -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
this is looking super buggy. if i click around my site, one moment it can find the model the next it can't. eg: "Fatal error: Class 'CalendarAppModel' not found in /Users/ willbarker/Dropbox/tractor2/Tractor/Plugin/Calendar/Model/Event.php on line 2" on a page that 5 mins ago worked fine. is there a way to look up where its looking for a model class? On Oct 20, 1:36 pm, "#2Will" wrote: > OK, its being ignored again. Haven't changed the code in the plugin > and have deleted the cache 18 times & even rebooted the machine. > > Does anybody have any clues whats going on here? > > w > > On Oct 18, 6:13 pm, "#2Will" wrote: > > > > > > > > > Oh. Now it works. But no idea why, so not so much a self rescue as a > > drift to the river bank. > > > I cleared some caches for about the millionth time and hay presto, the > > hasOne data shows up too. must have accidentally lined everything up > > at last. > > > ah well, on with the code. > > > On Oct 18, 6:05 pm, "#2Will" wrote: > > > > I upgraded to 2.0 today, which went quite smoothly, but i still have > > > this problem > > > > the book says: "You should get a “Missing Model” error" but i don't > > > at all. > > > > Looking in the included file list in debugkit - it is including the > > > controller files for the plugin, but not the model. I think its just > > > using the automagic model creation on the fly. (at least i think cake > > > does that) > > > > On Oct 17, 4:53 pm, "#2Will" wrote: > > > > > Hello > > > > > I'm trying to make a calendar plugin for 1.3. Its sort of working, > > > > but the Event model definition is being ignored and so its > > > > relationship to other models (in the main app) are not working. > > > > > I guess im putting it in the wrong place, but ive gone round and round > > > > and round in circles and its not getting better. > > > > > /app/plugins/calendar/models/event.php > > > > > > > class Event extends CalendarAppModel { > > > > var $name = 'Event'; > > > > etc > > > > > /app/plugins/calendar/controllers/events_controller.php > > > > > > > > class EventsController extends CalendarAppController { > > > > var $uses = array('Calendar.Event'); > > > > > etc. > > > > > As far as i can see that should work. Any suggestions why it isn't or > > > > how to work out why it isn't working very much appreciated. Stumped. > > > > > will -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
OK, its being ignored again. Haven't changed the code in the plugin and have deleted the cache 18 times & even rebooted the machine. Does anybody have any clues whats going on here? w On Oct 18, 6:13 pm, "#2Will" wrote: > Oh. Now it works. But no idea why, so not so much a self rescue as a > drift to the river bank. > > I cleared some caches for about the millionth time and hay presto, the > hasOne data shows up too. must have accidentally lined everything up > at last. > > ah well, on with the code. > > On Oct 18, 6:05 pm, "#2Will" wrote: > > > > > > > > > I upgraded to 2.0 today, which went quite smoothly, but i still have > > this problem > > > the book says: "You should get a “Missing Model” error" but i don't > > at all. > > > Looking in the included file list in debugkit - it is including the > > controller files for the plugin, but not the model. I think its just > > using the automagic model creation on the fly. (at least i think cake > > does that) > > > On Oct 17, 4:53 pm, "#2Will" wrote: > > > > Hello > > > > I'm trying to make a calendar plugin for 1.3. Its sort of working, > > > but the Event model definition is being ignored and so its > > > relationship to other models (in the main app) are not working. > > > > I guess im putting it in the wrong place, but ive gone round and round > > > and round in circles and its not getting better. > > > > /app/plugins/calendar/models/event.php > > > > > class Event extends CalendarAppModel { > > > var $name = 'Event'; > > > etc > > > > /app/plugins/calendar/controllers/events_controller.php > > > > > > class EventsController extends CalendarAppController { > > > var $uses = array('Calendar.Event'); > > > > etc. > > > > As far as i can see that should work. Any suggestions why it isn't or > > > how to work out why it isn't working very much appreciated. Stumped. > > > > will -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
Oh. Now it works. But no idea why, so not so much a self rescue as a drift to the river bank. I cleared some caches for about the millionth time and hay presto, the hasOne data shows up too. must have accidentally lined everything up at last. ah well, on with the code. On Oct 18, 6:05 pm, "#2Will" wrote: > I upgraded to 2.0 today, which went quite smoothly, but i still have > this problem > > the book says: "You should get a “Missing Model” error" but i don't > at all. > > Looking in the included file list in debugkit - it is including the > controller files for the plugin, but not the model. I think its just > using the automagic model creation on the fly. (at least i think cake > does that) > > On Oct 17, 4:53 pm, "#2Will" wrote: > > > > > > > > > Hello > > > I'm trying to make a calendar plugin for 1.3. Its sort of working, > > but the Event model definition is being ignored and so its > > relationship to other models (in the main app) are not working. > > > I guess im putting it in the wrong place, but ive gone round and round > > and round in circles and its not getting better. > > > /app/plugins/calendar/models/event.php > > > class Event extends CalendarAppModel { > > var $name = 'Event'; > > etc > > > /app/plugins/calendar/controllers/events_controller.php > > > > class EventsController extends CalendarAppController { > > var $uses = array('Calendar.Event'); > > > etc. > > > As far as i can see that should work. Any suggestions why it isn't or > > how to work out why it isn't working very much appreciated. Stumped. > > > will -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Can't get Plugin model to work / be noticed at all
I upgraded to 2.0 today, which went quite smoothly, but i still have this problem the book says: "You should get a “Missing Model” error" but i don't at all. Looking in the included file list in debugkit - it is including the controller files for the plugin, but not the model. I think its just using the automagic model creation on the fly. (at least i think cake does that) On Oct 17, 4:53 pm, "#2Will" wrote: > Hello > > I'm trying to make a calendar plugin for 1.3. Its sort of working, > but the Event model definition is being ignored and so its > relationship to other models (in the main app) are not working. > > I guess im putting it in the wrong place, but ive gone round and round > and round in circles and its not getting better. > > /app/plugins/calendar/models/event.php > class Event extends CalendarAppModel { > var $name = 'Event'; > etc > > /app/plugins/calendar/controllers/events_controller.php > > class EventsController extends CalendarAppController { > var $uses = array('Calendar.Event'); > > etc. > > As far as i can see that should work. Any suggestions why it isn't or > how to work out why it isn't working very much appreciated. Stumped. > > will -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Can't get Plugin model to work / be noticed at all
Hello I'm trying to make a calendar plugin for 1.3. Its sort of working, but the Event model definition is being ignored and so its relationship to other models (in the main app) are not working. I guess im putting it in the wrong place, but ive gone round and round and round in circles and its not getting better. /app/plugins/calendar/models/event.php http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php