![]() |
[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) (/showthread.php?tid=18196) |
[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]emorling[/eluser] Quote:I don’t know if you still need the information, but there is nothing I know of that can cause CI to reload the same function, EXCEPT if you are accidentally calling $this->{controller_method}. This is driving me nuts. ![]() I run this. Quote:function dosell($char_id, $item_id){ Like this I get output "item does not exist". If I comment the line $item->delete() I get "item exist". My conclusion is that somehow the controller method is called twice. First it exists, and is deleted, and then it enters a second time and does not exist. How can I debug further? Is there a debugger for CI? If it is being called a second time, how can I kill it the first time around? I tried using "die" but that didn't help. This is my Item model. As you can see it has two hasOne relationships. I don't know if they can cause any trouble? Quote:class Item extends DataMapper { [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]emorling[/eluser] OK, This is an update. I have now read up on the debugger in CI. This is the controller I run. Code: function dosell($char_id, $item_id){ And this is the LOG: Quote:DEBUG - 2009-09-17 19:43:38 --> Config Class Initialized See the bolded items above. This confirms that the controller is run twice. It has to do with the row item->delete(), Any ideas? [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]OverZealous[/eluser] @emorling Did you name a controller the same name as a model? You can't do that. This isn't a DMZ issue, because DMZ doesn't call controllers ever. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]OverZealous[/eluser] [quote author="Daniel H" date="1253224385"]Is it at all possible to load all an object's related 'has one' objects on an ad hoc basis, instead of specifying it in the config?[/quote] Yes, you call get() on each of the objects you want to load. :-) If you have a lot of them, throw'em in a function on the model itself. If you want to load them when you run a query, make a custom getter that looks like this: Code: function get_autoload($limit = '', $start = '') { You really should load objects manually, anyway, otherwise you'll end up loading unnecessary information all the time. I also saw your previous comment a while ago, but I forgot about it. The short version is that I would assume there either is a bug in HTMLForm or Array, or your models are misconfigured. I don't have time right now to work on the extensions, but if you feel like debugging it some more, I'll happily apply a fix. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]emorling[/eluser] [quote author="OverZealous" date="1253240621"]@emorling Did you name a controller the same name as a model? You can't do that. This isn't a DMZ issue, because DMZ doesn't call controllers ever.[/quote] Hm. None of my controllers have the same name as a model. Or do you see something I don't? [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]OverZealous[/eluser] [quote author="emorling" date="1253241698"]Hm. None of my controllers have the same name as a model. Or do you see something I don't?[/quote] Nope, just throwing out suggestions. When I look at your log, I see two complete requests to the server. This means the browser is sending two requests. It has nothing to do with DMZ at all. (You wouldn't see the config and other class get re-initialized otherwise.) [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]emorling[/eluser] [quote author="OverZealous" date="1253241954"]When I look at your log, I see two complete requests to the server. This means the browser is sending two requests. It has nothing to do with DMZ at all. (You wouldn't see the config and other class get re-initialized otherwise.)[/quote] Strange indeed. I am running Fiddler with Firefox and I see only one HTTP request, not two. [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]emorling[/eluser] Since this is not a DMZ problem I moved the discussion here: http://ellislab.com/forums/viewthread/129445/ [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]Mirage[/eluser] <b>Possible bug with created_field<b> I have a table with the 'created' and 'updated' columns. DMZ (1.5.2) appears to be updating both columns with the current timestamp. Do I need to literally submit the created timestamp when updating existing records? Code: // Example sippet Thanks, J [Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) - El Forum - 09-17-2009 [eluser]OverZealous[/eluser] [quote author="Mirage" date="1253244323"]Do I need to literally submit the created timestamp when updating existing records?[/quote] No, created and updated are updated correctly, based on whether an object exists or not. You never need to set them manually. If you set the column type to timestamp, however, some databases will automatically update those columns every time the row changes. Check out your database's documentation; it probably has nothing to do with DataMapper. |