Thursday, February 7, 2013

Re: Digest for cake-php@googlegroups.com - 9 Messages in 4 Topics



Sent from my iPhone

On 08-Feb-2013, at 10:29 AM, cake-php@googlegroups.com wrote:

Group: http://groups.google.com/group/cake-php/topics

    Mathew <nfoscarini@yahoo.com> Feb 07 01:06PM -0800  

    Hi,
     
    I have a problem. When I call Router::parse('/something/index') it returns
    an array which contains the prefix (i.e. 'admin'=>1) when called during a
    request that has a prefix set.
     
    That's a problem, because the string '/something/index' doesn't have the
    prefix set. It should return it if '/admin/something/index' was used.
     
    Is this a bug or by design, and if by design, please explain why.

     

    lowpass <zijn.digital@gmail.com> Feb 07 09:38PM -0500  

    Do you have a route defined for /admin/something/index but not for
    /something/index?
     

     

    Mathew <nfoscarini@yahoo.com> Feb 07 07:24PM -0800  

    Thanks for replying.
     
    I have only 1 route defined.
     
    Router::connect('/',array('controller'=>'pages','action'=>'display','home'));
    require CAKE . 'Config' . DS . 'routes.php';
     
    If I run Router::parse('/') from an admin prefix then I get this URL back
    'http://cgtag.local/admin/pages/display/home' which doesn't exist.
     
    It's actually the part of the website that calculates the exit URL for the
    admin section. In this example it's to just the homepage, but in other
    cases it might not be.
     
    On Thursday, 7 February 2013 21:38:05 UTC-5, cricket wrote:

     

    Mathew <nfoscarini@yahoo.com> Feb 07 07:26PM -0800  

    Even if I change the Router to this.
     
    Router::connect('/',array('admin'=>false,'controller'=>'pages','action'=>'display','home'));
     
    It still doesn't work.
     
    On Thursday, 7 February 2013 21:38:05 UTC-5, cricket wrote:

     

    "Advantage+" <movepixels@gmail.com> Feb 07 10:48PM -0330  

    Still no luck with this mystery.
     

     
    I dropped the db table and recreated it. Same thing, refuses to save those 2
    fields. (Fields in bold in the array below)
     
    So the fields are populated with the data, when I remove the debug / die it
    saves everything except these 2 maddening fields!
     

     
    public function beforeSave(){
     

     
    debug($this->data['Order']);
     
    die();
     
    }
     

     
    I dump the data before the save in the Order model:
     

     
    /app/Model/Order.php (line 55)
     
    array(
     
    'first_name' => 'Dave',
     
    'last_name' => 'Dave',
     
    'email' => 'dave@here.com',
     
    'phone' => '555-555-5555',
     
    'billing_address' => '123 King',
     
    'billing_address2' => '',
     
    'billing_city' => 'St Johns',
     
    'billing_state' => 'NL',
     
    'billing_zip' => '12345',
     
    'billing_country' => 'CA',
     
    'sameaddress' => '0',
     
    'shipping_address' => 'Ship 1',
     
    'shipping_address2' => 'Ship 2',
     
    'shipping_city' => 'Ship City',
     
    'shipping_state' => 'Ship State',
     
    'shipping_zip' => 'Ship Zip',
     
    'shipping_country' => 'Ship CA',
     
    'order_type' => 'creditcard',
     
    'order_item_count' => (int) 2,
     
    'quantity' => (int) 10,
     
    'weight' => '12.50',
     
    'subtotal' => '349.90',
     
    'total' => '349.90',
     
    'shop' => (int) 1,
     
    'status' => (int) 1,
     
    'user_id' => '51145f50-3058-47cf-b7ef-61f0c09b532a',
     
    'correlation_id' => 'e448a45e8d429',
     
    'transaction_id' => '2LH603618P261513G',
     
    'modified' => '2013-02-07 18:13:42',
     
    'created' => '2013-02-07 18:13:42'
     
    )
     

     

     
    From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
    Of crush
    Sent: Thursday, February 07, 2013 4:36 AM
    To: cake-php@googlegroups.com
    Subject: Re: Can not save two fields
     

     
    Make sure you delete the model caches, debug level 1 and maybe reload apache
    to force it to recheck the DB and see the new fields. That's gotten me a few
    times when it just wouldn't save something.
     
    Also, just in case, you can do a $this->Model->save($this->request->data,
    array('validate'=>false)); to make sure the validation is still not a
    problem.
     
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups
    "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

     

    lowpass <zijn.digital@gmail.com> Feb 07 09:48PM -0500  


    > 'correlation_id' => 'e448a45e8d429',
    > 'transaction_id' => '2LH603618P261513G',
     
    Earlier you said the fields were correlation and transaction, but here
    they're correlation_id and transaction_id. I'm guessing your form
    inputs use the latter names and Cake is dropping them because they
    don't match the schema.

     

    "Advantage+" <movepixels@gmail.com> Feb 07 11:46PM -0330  

    No, from the beginning they were as you see now, then in talks last night we
    changed the 2 fields in question to something without _ underscore to see if
    anything happened but the $order['Order'][fields] matched up all the same in
    the controller to db.
     
    These are not fields in the form, authorization / transaction info sent back
    from merchant account based on successful payment so just manually adding it
    to the data to be saved.
     
    if( $process_payment['ACK'] === 'Success'){
     
    $order['Order']['correlation_id'] =
    $process_payment['CORRELATIONID'];
    $order['Order']['transaction_id'] =
    $process_payment['TRANSACTIONID'];
    }
     
    And rest of the code.......
     
    $save = $this->Order->saveAssociated($order,array('validate'=>false) );
     
    -----Original Message-----
    From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
    Of lowpass
    Sent: Thursday, February 07, 2013 11:19 PM
    To: cake-php@googlegroups.com
    Subject: Re: Can not save two fields
     
     
    > 'correlation_id' => 'e448a45e8d429',
    > 'transaction_id' => '2LH603618P261513G',
     
    Earlier you said the fields were correlation and transaction, but here
    they're correlation_id and transaction_id. I'm guessing your form inputs use
    the latter names and Cake is dropping them because they don't match the
    schema.
     
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter
    http://twitter.com/CakePHP
     
    ---
    You received this message because you are subscribed to the Google Groups
    "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

     

    "Vanja Dizdarević" <lex.non.scripta@gmail.com> Feb 07 11:11AM -0800  

    A crazy error this was.
     
    While I was editing the files on the server via command line, mod_rewrite
    wouldn't do anything except throw errors.
     
    After updating it via SFTP, it did the job.
     
    I went ahead and refined your example a little bit:
     
    <IfModule mod_rewrite.c>
    RewriteEngine on
     
    RewriteCond %{REQUEST_URI} !^/(?:development)(?:$|/)
    RewriteRule ^$ app/webroot/ [L]
     
    RewriteCond %{REQUEST_URI} !^/(?:development)(?:$|/.*)
    RewriteRule (.*) app/webroot/$1 [L]
     
    </IfModule>
     
    To see a multiple-folder "ignore", check the snippet out on Gist<https://gist.github.com/dizyart/4733257>
    .
     
    Thanks Chetan, for pointing me in the right direction.

     

    Baldomero Aguila <dexters1998@gmail.com> Feb 06 06:10PM -0800  

    hello, my language is esapañol to if I write bad in English
    but I try
     
    the query is, someone integrated colorbox class of ajax in cakephp?
     
     
    i do not know how, if anyone knows can help me?
    thanks

     

You received this message because you are subscribed to the Google Group cake-php.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: