Welcome Guest, Not a member yet? Register   Sign In
[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition)

[eluser]warrennz[/eluser]
@OverZealous

Thank you. I guess I just over complicated a simple problem and solution in my head. Smile

New docs are awesome btw Big Grin Good stuff

Cheers

[eluser]tdktank59[/eluser]
Just a note... I don't know if it ever got fixed officialy. But I was able to do it myself.

The inflector_helper has a problem with status/statuses I was able to correct this by doing this

* Code removed since it was added to 1.3.1

[eluser]OverZealous[/eluser]
Thanks, I'll update the one included with DMZ!

[eluser]OverZealous[/eluser]
DataMapper OverZealous Edition Update
Quote:Version 1.3.1: Small, but important, updates on this version:

Custom Validation Rules in Extensions: Extensions now support custom validation rules. Learn more about validation rules in extensions.

Updated Inflector Helper: Modified inflector_helper based on a recommendation by tdktank59, and also fixed words like address that end in a double-s.

New Upgrading Page in Manual: The manual now includes a page on upgrading, so you can find what needs to be changed quickly.

Quote:Download the Latest Version Here

View the change log and the upgrade process
Having issues? Please look through the Troubleshooting Guide & FAQs
View the Complete Manual

[eluser]tdktank59[/eluser]
I hope you looked over my revision OverZealous lol... I made it work for what I was using... I never tested it other than the other words I was using but I guess since you added the double-s support you did look it over!

BTW the cache seems to be working, havnt noticed much difference yet but also haven't been looking for it. (Little occupied with other things today)

[eluser]OverZealous[/eluser]
Yep, I checked it over. It seems like a fine solution to me.

I'm not sure if the production cache will do anything important or not. Personally, I just couldn't stand having all those unnecessary database accesses, so it at least helps reduce some of them, as well as some of the class start-up overhead. It will probably be more useful on high-volume sites.

[eluser]tdktank59[/eluser]
Well this will be a intranet site for my client... And there will be quite a bit of database stuff going on.

I can see the biggest improvements being when I run the statistics on everything in the database!

But yeah I agree why keep doing that IO stuff when you can cache it and read it right away...

[eluser]tdktank59[/eluser]
Might have found a bug...

So I can save the new DQIP however it does not save the brainstorm relation to the dqip which is a MANY to MANY relation. (Yes its defined in the models)

Any ideas? All the values are getting passed right just can't seem to get the relation to save. (Also the tables do exist checked that a few times...)

Code Not throwing error when there is an error somewhere...
Code:
// See if this was promoted
if ($this->input->post('brainstorm_id'))
{
    // It was a brainstorm being promoted so lets relate the brainstorm to the new dqip
    $b = new Brainstorm();
    $b->where('id',$this->input->post('brainstorm_id'))->get();

    if (!$d->save($b->all))
    echo 'Error: '.$b->error->string;
}

Full Source
Code:
$d = New Dqip();

        // If we are editing the form
        if ($this->input->post('id'))
            $d->where('id',$this->input->post('id'))->get();

        // Required Fields
        // Setting values here...

        if (!$d->save())
        {
            // Spit out an error and
            // Load the right page
        }
        else
        {
/** NOT WORKING HERE **/
            // See if this was promoted
            if ($this->input->post('brainstorm_id'))
            {
                // It was a brainstorm being promoted so lets relate the brainstorm to the new dqip
                $b = new Brainstorm();
                $b->where('id',$this->input->post('brainstorm_id'))->get();

                if (!$d->save($b))
                    echo 'Error: '.$d->error->string;
            }
/** END NOT WORKING HERE **/
            // Spit out the right message
        }

[eluser]OverZealous[/eluser]
You didn't provide enough information to debug. There's nothing I can glean from all that.

Are you sure you are getting something to save? IE: does $b->all or $b actually contain anything? There's no checks there to ensure that
Code:
$b->where('id',$this->input->post('brainstorm_id'))->get();
actually returns a valid item.

Try debugging a little more on your own.

Also, please, when copying in code in the future, take the time to pare it down. I'd rather not scroll through 2 pages of setting variables just to get to the meat. ;-)

[eluser]tdktank59[/eluser]
Yes its grabbing the Brainstorm... ($b->stored returns the correct values)
Code:
stdClass Object
(
    [id] => 1
    [title] => Test Brainstorm
    [description] => This brainstorm is a test to make sure it is working
    [orgin_date] => 1245124800
    [estimated_count_auto] => 1222
    [estimated_count_manual] => 122
    [created_on] => 1245187233
    [updated_on] => 1245193574
    [author_id] => 2
    [data_source_1_id] => 30
    [data_source_2_id] => 0
    [priority_id] => 0
    [issue_type_id] => 3
    [status_id] => 1
)

I am literally giving you everything I have here... I am not getting any error messages, The initial save does work. (It saves the dqip)
However it does not want to save the relationship in the second save...




Theme © iAndrew 2016 - Forum software by © MyBB