Welcome Guest, Not a member yet? Register   Sign In
DMZ 1.7.1 (DataMapper OverZealous Edition)

[eluser]broofa[/eluser]
Thanks for the quick reply, Phil.

[quote author="OverZealous" date="1277451111"]
Well, I don't have any control over what stensi does with his domain. I don't understand why you would assume that... And DataMapper isn't deprecated. It's just not upgraded any more.[/quote]

'Wasn't assuming you had control over stensi.com. Rather, it's pretty clear you're carrying the baton on this codebase now. So sending an email to stensi.com asking that he point people to the DMZ site would seem an obvious thing to do (especially since you don't show up in the first page of google results for "php datamapper" and stensi.com does). I'm happy to do that if you'd like, but it would make more sense if that came from you.

Quote:As for your configuration problems, I'm sorry but the very first item in the upgrade process tells you to update your datamapper config. And the config page explicitly lists the items that are new to DMZ.

By documenting "default" values for these parameters you set up the expectation that they aren't required. (That's what "default" means). So either the code should change to provide default values when none are found in the config file, or docs should describe these as required properties with "suggested" values.

Quote:As for your other errors, you probably need to spend some time reading the manual. Setting db_params to FALSE is not recommended, and just not necessary since 1.7.

While it's entirely possible my problems are specific to my application, this isn't a problem of me not having read the manual. 'Read it several times. And I'm now at the point where I'm stepping through DMZ and CI code trying to understand what I might be doing wrong. Unfortunately with the default config settings, I'm seeing errors. That's the *only* reason I'm using the FALSE value for db_params, and also the only reason I have lang_file_format=''. If you have better suggestions for how to avoid (or understand what might be causing) these errors, I would love to hear them. (e.g. is it possible there's something different in CI 1.7.2 that might be causing these?)

Cheers,

- rwk

[eluser]broofa[/eluser]
Quick followup to my previous post...

It seems that some of these errors are a result of $CI->config being undefined when _assign_libraries() is called by the DataMapper constructor. Any idea what might be causing that?

- rwk

[eluser]TheJim[/eluser]
[quote author="broofa" date="1277498105"]Quick followup to my previous post...

It seems that some of these errors are a result of $CI->config being undefined when _assign_libraries() is called by the DataMapper constructor. Any idea what might be causing that?

- rwk[/quote]

That's odd. I think you mentioned using CI 1.7.2 in your earlier post, which I also use, and which I believe (though I could be wrong) Phil uses as well. So I wouldn't think it has to do with your version of CI.

Could you be trying to instantiate DMZ objects before CI is fully initialized? Say, in a pre-system hook or in a controller's constructor without first calling the parent's constructor. Anything like that?

[eluser]broofa[/eluser]
[quote author="TheJim" date="1277520776"][quote author="broofa" date="1277498105"]Quick followup to my previous post...

It seems that some of these errors are a result of $CI->config being undefined when _assign_libraries() is called by the DataMapper constructor. Any idea what might be causing that?

- rwk[/quote]

That's odd. I think you mentioned using CI 1.7.2 in your earlier post, which I also use, and which I believe (though I could be wrong) Phil uses as well. So I wouldn't think it has to do with your version of CI.

Could you be trying to instantiate DMZ objects before CI is fully initialized? Say, in a pre-system hook or in a controller's constructor without first calling the parent's constructor. Anything like that?[/quote]

I found the problem. I incorrectly implemented a __set method in my DataMapper subclass which was causing the DM reference to the $CI->config object (set in _assign_libraries) to be set to null. Thus producing the "non-object" errors I kept seeing elsewhere.

So... pretty much my own fault after all. Shoulda known I guess, but in my defense this wasn't exactly the most obvious bug. Regardless, my apologies for bothering folks - everything's working just peachy now!

- rwk

[eluser]lexusgs430[/eluser]
Question:

Everythings been going smoothly til last night. I got a called to undefined function error in one of my models and no matter what I do I cant seem to fix it. (all the other models/controllers have been working fine.

Fatal error: Call to undefined method Style::_get_style_by_sku()

Anyone have any idea in general what can cause an error like this in just one model?

[eluser]OverZealous[/eluser]
@lexusgs430
This is not a DMZ issue.

See the Troubleshooting Guide for suggestions.

[eluser]lexusgs430[/eluser]
Ok so I was making changes to one of my models, and then all of the sudden I get 503 service error on any page I try to access. I contact my webhost they tell me its definitely my making changes to the code. But I undid what I did (I was adding a new relationship in the model, so I deleted it.) -- but still nothing works any idea what could be causing it or how I could fix it?

[eluser]lexusgs430[/eluser]
actually got it figured out, of course it took me an hour to figure it out, but not until immediately after asking for help after that hour passed.. problem was I was self referencing a model in a model I must have made changes to thinking it was the controller. sigh.

[eluser]lexusgs430[/eluser]
sorry for so many questions so quickly Smile

Having trouble formatting a count distinct query, was hoping you could shed some light.

Im calling the following within a result array.

Code:
$i = new Item();
    $itemCount = $i->where('style_id', $result->id)->count();
    $sitesCount = $i->where('style_id', $result->id)->count_distinct('site_id');

The itemCount works fine. The sitesCount just returns the same as itemCount, even though there usually maybe half the number of distinct site_ids for each particular result. Im sure Im just formatting it wrong but Im having trouble figuring out exactly how to format it.

[eluser]OverZealous[/eluser]
@lexusgs430
First, you are using the method wrong. Read the docs again. The first parameter is the list of IDs to exclude. The second parameter is the column to use DISTINCT on.

Before submitting a question, you should look at the queries being generated. There's some good tips for debugging in the troubleshooting guide, at the top. They walk you through some basic debugging steps. You probably would have easily seen that the query being generated was not what you expected.




Theme © iAndrew 2016 - Forum software by © MyBB