Re: Bug: flaws in email validation/sending

2016-01-31 Thread euromark
Please open a ticket at https://github.com/cakephp/cakephp/issues
This is just a discission board, not a bug tracker.

Mark


Am Samstag, 30. Januar 2016 05:33:10 UTC+1 schrieb Kim:
>
>
>- CakePHP's email validation allows non-ASCII letter characters, e.g. 
>á, in the  local part of the email address (by the \p{L} unicode category 
>construct). This should not be allowed, see 
>https://en.wikipedia.org/wiki/Email_address#Local_part.
>- It also allows non-ASCII letter characters in the domain part. This 
>allows Internationalized Domain Names (IDN). The problem here lies in the 
>fact that this is not supported by the SmtpTransport. An SMTP client 
> should 
>convert them to so called punycode ASCII, according to 
>https://lists.exim.org/lurker/message/20140812.120609.bf764769.en.html. 
>MTA exim does not accept the SMTP sequence. By the way, conversion to 
>punycode can be done by PHP's idn_to_ascii().
>
> This issues have been tested in the current 2.7 branch, but a quick code 
> inspection confirms that they are also present in the master branch. As a 
> workaround I have switched back to validation by PHP's filter_var(), used 
> in a wrapper validation method.
>
> The first issue can be fixed easily, although the right RFCs have to be 
> consulted. For the second issue, we have to decide if we support IDN for 
> email and if we do, support it (maybe not only in the SmtpTransport).
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: BUg in 2.5 ? database session blows up csrf checks (Cakephp 2.5.0-RC1 )

2014-04-23 Thread mark_story
What does your session config data look like?

Mark

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


Re: BUg in 2.5 ? database session blows up csrf checks (Cakephp 2.5.0-RC1 )

2014-04-22 Thread Mandar P
Thanks Mark

What debug data should i supply to confirm above issue?




On Tuesday, 22 April 2014 03:35:51 UTC+1, mark_story wrote:
>
> I just checked locally on a new copy of CakePHP 2.5.0, and wasn't able to 
> reproduce the issue.
>
> I used a baked MVC, SecurityComponent and set 'defaults' => 'database' in 
> core.php for the session setup.
>
> -Mark
>
> On Friday, 18 April 2014 18:09:23 UTC-4, Mandar P wrote:
>>
>> Any one have any idea how to fix this issue ?
>>
>> Thanks,
>> Mandar
>>
>>
>>
>> On Thursday, 17 April 2014 15:27:26 UTC+1, Mandar P wrote:
>>>
>>> Hi,
>>>
>>> Im using 2.5 to build simple crud application with csrf enabled.
>>>
>>> When using php based sessions everything works fine but changing it to 
>>> database sessions csrf black-hole occurs on edit form submission. Please 
>>> note that add form works absolutely fine irrespective of php/db based 
>>> session.
>>>
>>> Looking at request and session data i found that 
>>> SecurityComponent::_validateCsrf() method fails as data passed in 
>>> $controller->request->data('_Token.key') is not found in data read from 
>>> $this->Session->read('_Token')
>>>
>>> I think  :
>>>
>>> 1> either session is not being updated correctly with token key value 
>>> when form is created
>>>
>>> or
>>>
>>> 2> request data is tampered before it reaches security component
>>>
>>> I suspect problem is no.1 as forms work correctly when php based 
>>> sessions are used.
>>>
>>> Im also using debugkit and passwordHasher => Blowfish in app controller
>>>
>>> Any one have any ideas?
>>>
>>> Thanks,
>>> Mandar
>>>
>>>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


Re: BUg in 2.5 ? database session blows up csrf checks (Cakephp 2.5.0-RC1 )

2014-04-21 Thread mark_story
I just checked locally on a new copy of CakePHP 2.5.0, and wasn't able to 
reproduce the issue.

I used a baked MVC, SecurityComponent and set 'defaults' => 'database' in 
core.php for the session setup.

-Mark

On Friday, 18 April 2014 18:09:23 UTC-4, Mandar P wrote:
>
> Any one have any idea how to fix this issue ?
>
> Thanks,
> Mandar
>
>
>
> On Thursday, 17 April 2014 15:27:26 UTC+1, Mandar P wrote:
>>
>> Hi,
>>
>> Im using 2.5 to build simple crud application with csrf enabled.
>>
>> When using php based sessions everything works fine but changing it to 
>> database sessions csrf black-hole occurs on edit form submission. Please 
>> note that add form works absolutely fine irrespective of php/db based 
>> session.
>>
>> Looking at request and session data i found that 
>> SecurityComponent::_validateCsrf() method fails as data passed in 
>> $controller->request->data('_Token.key') is not found in data read from 
>> $this->Session->read('_Token')
>>
>> I think  :
>>
>> 1> either session is not being updated correctly with token key value 
>> when form is created
>>
>> or
>>
>> 2> request data is tampered before it reaches security component
>>
>> I suspect problem is no.1 as forms work correctly when php based sessions 
>> are used.
>>
>> Im also using debugkit and passwordHasher => Blowfish in app controller
>>
>> Any one have any ideas?
>>
>> Thanks,
>> Mandar
>>
>>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


Re: BUg in 2.5 ? database session blows up csrf checks (Cakephp 2.5.0-RC1 )

2014-04-20 Thread Mandar P
Any one have any idea how to fix this issue ?

Thanks,
Mandar



On Thursday, 17 April 2014 15:27:26 UTC+1, Mandar P wrote:
>
> Hi,
>
> Im using 2.5 to build simple crud application with csrf enabled.
>
> When using php based sessions everything works fine but changing it to 
> database sessions csrf black-hole occurs on edit form submission. Please 
> note that add form works absolutely fine irrespective of php/db based 
> session.
>
> Looking at request and session data i found that 
> SecurityComponent::_validateCsrf() method fails as data passed in 
> $controller->request->data('_Token.key') is not found in data read from 
> $this->Session->read('_Token')
>
> I think  :
>
> 1> either session is not being updated correctly with token key value when 
> form is created
>
> or
>
> 2> request data is tampered before it reaches security component
>
> I suspect problem is no.1 as forms work correctly when php based sessions 
> are used.
>
> Im also using debugkit and passwordHasher => Blowfish in app controller
>
> Any one have any ideas?
>
> Thanks,
> Mandar
>
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


Re: Bug in edit user

2013-05-20 Thread lowpass
> $this->request->data['User']['id'] = $this->Auth->user('id');

You are assigning the administrator's id to the record. Unless your
administrator is trying to edit its own record, this is not what you want.


On Fri, May 17, 2013 at 2:23 PM, Guilherme Magno wrote:

> Hello people,
> I'm having a big problem on the editing a User,
> I use the following code:
>
>  class UsersController extends AppController {
>
> public function beforeFilter() {
>parent::beforeFilter();
> }
>
> ...
>
>
> public function edit($id = null) {
>$this->request->data['User']['id'] = $this->Auth->user('id');
>if (!( $this->User->exists($id) ) || !( $id ==
> $this->Auth->user('id') )) {
>   $this->Session->setFlash(__('Invalid user'));
>   $this->redirect('index');
>}
>if ($this->request->is('post') || $this->request->is('put')) {
>
> /*   if ($this->request->data['User']['is_banned'] == true) {
> $this->Session->setFlash(__('Conta permanentemente banida,
> para reculperá-la mande um e-mail para a adminstração.'), 'default',
> array('class' => 'success'));
> $this->redirect(array('controller' => 'users', 'action' =>
> 'logout', 'admin' => false));
> } */
>   if ($this->User->save($this->request->data)) {
>  $this->Session->setFlash(__('Salvo com sucesso.'), 'default',
> array('class' => 'success'));
>  //$this->redirect(array('action' => 'index'));
>   } else {
>  $this->Session->setFlash(__('The user could not be saved.
> Please, try again.'));
>   }
>} else {
>
>   $options = array('conditions' => array('User.' .
> $this->User->primaryKey => $id));
>   $this->request->data = $this->User->find('first', $options);
>}
> }
> }
> VIEW
>
> 
>
> Form->create('User'); ?>
>
> 
>
> 
>
> 
> echo $this->Form->input('username');
>
> echo $this->Form->input('password', array(
>
>  'value' => ''
>
>   ));
>
> echo $this->Form->input('is_banned', array(
>
>  'label' => __('Desabilitar permanentemente')
>
>   ));
>
> ?>
>
> 
>
> Form->end(__('Submit')); ?>
>
> 
>
>
>
>
> and this error I get the following error
> AclNode :: node () - Could not find Aro node problem identified by "Array
> ([Aro0.model] => User [Aro0.foreign_key] => 1)"
>
> I am logged in as administrator, I have the following in permições
> allowedActions:
>
> (int) 1 => 'index',
>   (int) 2 => 'add',
>   (int) 3 => 'login',
>   (int) 4 => 'view',
>   (int) 5 => 'logout',
>   (int) 6 => 'edit',
>   (int) 7 => 'admin_delete',
>   (int) 8 => 'admin_logout',
>   (int) 9 => 'admin_login',
>   (int) 10 => 'admin_index',
>
>
> I do not know the cause of this error, however I know that if I remove
> this line:
> $this->request->data['User']['id'] = $this->Auth->user('id');
>
> the error no longer occurs
>
>
>
> helppp mee plzz
>
> --
> 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+unsubscr...@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.
>
>
>

-- 
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+unsubscr...@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.




Re: Bug on Manually Login with AuthComponent

2013-05-02 Thread Jeremy Burns | Class Outfit
Have a look at the Auth session key. It ought to have a ['User'] key. I have 
noticed that on occasions it gets a ['User']['User'] key when doing a manual 
login. If that's the case, you just need to check the shape of the array you 
pass in to the login function. Might not be the answer, but I've had issues 
here myself before.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 3 May 2013, at 05:56:00, lhas  wrote:

> Hi, people!
> 
> I'm doing a manual login action, where i find the user based on your username 
> (findByUsername).
> 
> If the user exists, i want to force login the user to the AuthComponent. 
> Else, i register the user (success).
> 
> When i try to force the login of the user, i have a some kind of bug:
> 
> I try to login like this:
> 
> $this->Auth->login($user_exists['User']);
> 
> Where $user_exists['User'] contains all the User array with all the user data 
> from the findByUsername.
> 
> After the $this->Auth->login(), i can debug, for example, 
> AuthComponent::user().
> 
> But when i redirect the user to another action, the Auth seems not to work. 
> Its like the manual login doesn't worked, and the user is redirected to the 
> login action again.
> 
> Someone knows what i doing wrong?
> 
> I will be very prettyful for some help. :)
> 
> Thanks for my possible bad english!
> 
> Cheers,
> @luizhrqas.
> 
> -- 
> 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+unsubscr...@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.
>  
>  

-- 
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+unsubscr...@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.




Re: Bug in CakeSession class

2013-03-14 Thread lowpass
On Thu, Mar 14, 2013 at 6:07 AM, majna  wrote:
> The value of self::started() can be "true" later on, when session is
> actually started, right?
> https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/CakeSession.php#L187
>
> I don't think it's a bug.

Oh, gosh ... [face palm]

-- 
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+unsubscr...@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.




Re: Bug in CakeSession class

2013-03-14 Thread majna
The value of self::started() can be "true" later on, when session is 
actually started, right?
https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/CakeSession.php#L187

I don't think it's a bug.

On Wednesday, March 13, 2013 1:26:19 AM UTC+1, Eduardo Barbosa Moreira 
wrote:
>
> There is an inconsistent logic in method start() in CakeSession class 
> (lib/Model/DataSource/CakeSession.php):
>
> at line 192 
>
> if (!$id && self::started())
>
> the value of self::started() is never "true" because it was tested at line 
> 183:
>
>
> if (self::started()) {
> return true;
> }
>
>
>
> How can i report this bug?
>
>

-- 
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+unsubscr...@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.




Re: Bug in CakeSession class

2013-03-13 Thread lowpass
On Tue, Mar 12, 2013 at 8:26 PM, Eduardo Barbosa Moreira
 wrote:
> There is an inconsistent logic in method start() in CakeSession class
> (lib/Model/DataSource/CakeSession.php):
>
> at line 192
>
> if (!$id && self::started())
>
> the value of self::started() is never "true" because it was tested at line
> 183:
>
>
> if (self::started()) {
> return true;
> }

Yeah, I'd say that one doesn't require a unit test to prove. It's in
the latest stable (2.3.1) and goes back to 2.0, when CakeSession first
appeared.

> How can i report this bug?

You can log a ticket here:

https://cakephp.lighthouseapp.com/tickets

You should search first to see if there's already an open ticket.

-- 
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+unsubscr...@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.




Re: Bug? CakePHP 1.3.15 and database name

2013-01-14 Thread naidim
Looks like this has already been reported, "fixed" but is still 
broken. 
http://cakephp.lighthouseapp.com/projects/42648/tickets/1357-database-name-cannot-contain-period

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Bug when using ClassRegistry::init for Components

2011-03-22 Thread euromark
i usually use
App::import('Component', 'Plugin.Something');
and manually create a new object


On 23 Mrz., 00:35, labianchin  wrote:
> Hi, guys.
>
> I pretend to load and initialize a component (e.g.
> SomethingComponent), so I use something like:
> ClassRegistry::init('Plugin.Something', 'Component')
>
> The problem is that as in the line 140 of the file class-registry
> (http://api.cakephp.org/view_source/class-registry/#line-99) we have
>   if (class_exists($class) || App::import($type, $pluginPath .
> $class)) {
>       ${$class} =& new $class($settings);
>
> We'll I think this block of code is not considering the naming
> convetions of CakePHP and it should be something like:
>   if (class_exists($class) || App::import($type, $pluginPath .
> $class)) {
>       if (in_array($type, array('Behavior', 'Component',
> 'Controller'))){
>         $class .= $type;
>       }
>       ${$class} =& new $class($settings);
>
> Am I right or should I use it in a different way?

-- 
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: "Bug" with media.php CakePHP core file - HELP

2010-12-25 Thread Jesh
Okie i found the solution please refer to
http://www.php.net/manual/en/language.operators.errorcontrol.php#98895.

You can hack the cake_log.php handleError method, or create a own
error handler in bootstrap.php
Hope this help.

On Dec 20, 10:46 pm, BrendonKoz  wrote:
> Oh. I didn't realize I could move that in to my app; I figured only
> app_* and cake view/layout files could be moved to the app. That makes
> things much easier. Thanks, euromark!
>
> On Dec 16, 10:25 am, euromark  wrote:
>
> > you dont have to :)
> > just copy it into your /app/views/ folder
> > cake will use that file then from now on..
>
> > On 16 Dez., 15:35, BrendonKoz  wrote:
>
> > > Although I've been tempted to, I don't personally like modifying the
> > > core unless I also try to fix the problem that made me want to modify
> > > it in the first place (and then submit a ticket). I did a search on
> > > the issue, and it seems that CakePHP is not the only "framework" or
> > > project to suffer from this issue. Both Drupal and SilverStripe CMS
> > > have had the issue as well (SilverStripe fixed it; Drupal "fixed" it
> > > by commenting out the lines).
>
> > > I would imagine the call to ob_flush() is there for a reason, and
> > > simply removing it from the interpreter's view (commenting out) would
> > > detract from its purpose (I'm guessing its call is assisting with
> > > memory usage).
>
> > > Unfortunately since SilverStripe CMS uses its own internal framework
> > > that I am unfamiliar with, I was not able to figure out exactly *how*
> > > they fixed it.
>
> > > On Dec 15, 4:36 pm, euromark  wrote:
>
> > > > i had my log files filled up with that crap as well
> > > > just comment those lines out - worked for me :)
>
> > > > On 15 Dez., 18:18, BrendonKoz  wrote:
>
> > > > > I would like to trace down the issue I'm about to explain, but I
> > > > > unfortunately am not sure where to look. Any advice or help would be
> > > > > appreciated.
>
> > > > > I am continually getting NOTICE level error messages reported to
> > > > > debug.log from media.php:
> > > > > 2010-12-15 11:04:50 Notice: Notice (8): ob_flush() [ > > > > href='ref.outcontrol'>ref.outcontrol]: failed to flush buffer. No
> > > > > buffer to flush. in [/home/sspl/cake/libs/view/media.php, line 283]
>
> > > > >  ACTUAL LINES 
> > > > > function _flushBuffer() {
> > > > >         @flush();
> > > > >         @ob_flush();    // <-- error here}
>
> > > > > 
>
> > > > > Due to execution time looping (depending on the size of the file being
> > > > > served and the buffer), this notice can be (and is) repeated multiple
> > > > > times. This causes the debug.log file (on default core.php logging
> > > > > settings) to increase in size *very* rapidly. (I have since modified
> > > > > my core.php file to use E_ALL ^ E_NOTICE to prevent the file growth,
> > > > > but this is only a band-aid solution.)
>
> > > > > I have found two other CakePHP users that have mentioned the problem:
> > > > > 1.http://groups.google.com/group/cake-php/browse_thread/thread/65f03d0c...
> > > > > 2.http://groups.google.com/group/cake-php/browse_thread/thread/7b6ec1c1...
>
> > > > > There was a Lighthouse ticket for the 1.2.7 and 1.3.3 branches which
> > > > > has supposedly fixed the issue for 
> > > > > some:http://cakephp.lighthouseapp.com/projects/42648/tickets/882-regressio...
>
> > > > > ...but not all.
>
> > > > > It may be related to server configuration and (PHP?) server settings.
>
> > > > > Two questions:
> > > > > 1. Any ideas of where to start looking, and what to look at?
> > > > > 2. Should the debug.log still log errors of code that had used the
> > > > > suppression character (@) ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: "Bug" with media.php CakePHP core file - HELP

2010-12-20 Thread BrendonKoz
Oh. I didn't realize I could move that in to my app; I figured only
app_* and cake view/layout files could be moved to the app. That makes
things much easier. Thanks, euromark!

On Dec 16, 10:25 am, euromark  wrote:
> you dont have to :)
> just copy it into your /app/views/ folder
> cake will use that file then from now on..
>
> On 16 Dez., 15:35, BrendonKoz  wrote:
>
> > Although I've been tempted to, I don't personally like modifying the
> > core unless I also try to fix the problem that made me want to modify
> > it in the first place (and then submit a ticket). I did a search on
> > the issue, and it seems that CakePHP is not the only "framework" or
> > project to suffer from this issue. Both Drupal and SilverStripe CMS
> > have had the issue as well (SilverStripe fixed it; Drupal "fixed" it
> > by commenting out the lines).
>
> > I would imagine the call to ob_flush() is there for a reason, and
> > simply removing it from the interpreter's view (commenting out) would
> > detract from its purpose (I'm guessing its call is assisting with
> > memory usage).
>
> > Unfortunately since SilverStripe CMS uses its own internal framework
> > that I am unfamiliar with, I was not able to figure out exactly *how*
> > they fixed it.
>
> > On Dec 15, 4:36 pm, euromark  wrote:
>
> > > i had my log files filled up with that crap as well
> > > just comment those lines out - worked for me :)
>
> > > On 15 Dez., 18:18, BrendonKoz  wrote:
>
> > > > I would like to trace down the issue I'm about to explain, but I
> > > > unfortunately am not sure where to look. Any advice or help would be
> > > > appreciated.
>
> > > > I am continually getting NOTICE level error messages reported to
> > > > debug.log from media.php:
> > > > 2010-12-15 11:04:50 Notice: Notice (8): ob_flush() [ > > > href='ref.outcontrol'>ref.outcontrol]: failed to flush buffer. No
> > > > buffer to flush. in [/home/sspl/cake/libs/view/media.php, line 283]
>
> > > >  ACTUAL LINES 
> > > > function _flushBuffer() {
> > > >         @flush();
> > > >         @ob_flush();    // <-- error here}
>
> > > > 
>
> > > > Due to execution time looping (depending on the size of the file being
> > > > served and the buffer), this notice can be (and is) repeated multiple
> > > > times. This causes the debug.log file (on default core.php logging
> > > > settings) to increase in size *very* rapidly. (I have since modified
> > > > my core.php file to use E_ALL ^ E_NOTICE to prevent the file growth,
> > > > but this is only a band-aid solution.)
>
> > > > I have found two other CakePHP users that have mentioned the problem:
> > > > 1.http://groups.google.com/group/cake-php/browse_thread/thread/65f03d0c...
> > > > 2.http://groups.google.com/group/cake-php/browse_thread/thread/7b6ec1c1...
>
> > > > There was a Lighthouse ticket for the 1.2.7 and 1.3.3 branches which
> > > > has supposedly fixed the issue for 
> > > > some:http://cakephp.lighthouseapp.com/projects/42648/tickets/882-regressio...
>
> > > > ...but not all.
>
> > > > It may be related to server configuration and (PHP?) server settings.
>
> > > > Two questions:
> > > > 1. Any ideas of where to start looking, and what to look at?
> > > > 2. Should the debug.log still log errors of code that had used the
> > > > suppression character (@) ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: "Bug" with media.php CakePHP core file - HELP

2010-12-16 Thread euromark
you dont have to :)
just copy it into your /app/views/ folder
cake will use that file then from now on..

On 16 Dez., 15:35, BrendonKoz  wrote:
> Although I've been tempted to, I don't personally like modifying the
> core unless I also try to fix the problem that made me want to modify
> it in the first place (and then submit a ticket). I did a search on
> the issue, and it seems that CakePHP is not the only "framework" or
> project to suffer from this issue. Both Drupal and SilverStripe CMS
> have had the issue as well (SilverStripe fixed it; Drupal "fixed" it
> by commenting out the lines).
>
> I would imagine the call to ob_flush() is there for a reason, and
> simply removing it from the interpreter's view (commenting out) would
> detract from its purpose (I'm guessing its call is assisting with
> memory usage).
>
> Unfortunately since SilverStripe CMS uses its own internal framework
> that I am unfamiliar with, I was not able to figure out exactly *how*
> they fixed it.
>
> On Dec 15, 4:36 pm, euromark  wrote:
>
>
>
>
>
>
>
> > i had my log files filled up with that crap as well
> > just comment those lines out - worked for me :)
>
> > On 15 Dez., 18:18, BrendonKoz  wrote:
>
> > > I would like to trace down the issue I'm about to explain, but I
> > > unfortunately am not sure where to look. Any advice or help would be
> > > appreciated.
>
> > > I am continually getting NOTICE level error messages reported to
> > > debug.log from media.php:
> > > 2010-12-15 11:04:50 Notice: Notice (8): ob_flush() [ > > href='ref.outcontrol'>ref.outcontrol]: failed to flush buffer. No
> > > buffer to flush. in [/home/sspl/cake/libs/view/media.php, line 283]
>
> > >  ACTUAL LINES 
> > > function _flushBuffer() {
> > >         @flush();
> > >         @ob_flush();    // <-- error here}
>
> > > 
>
> > > Due to execution time looping (depending on the size of the file being
> > > served and the buffer), this notice can be (and is) repeated multiple
> > > times. This causes the debug.log file (on default core.php logging
> > > settings) to increase in size *very* rapidly. (I have since modified
> > > my core.php file to use E_ALL ^ E_NOTICE to prevent the file growth,
> > > but this is only a band-aid solution.)
>
> > > I have found two other CakePHP users that have mentioned the problem:
> > > 1.http://groups.google.com/group/cake-php/browse_thread/thread/65f03d0c...
> > > 2.http://groups.google.com/group/cake-php/browse_thread/thread/7b6ec1c1...
>
> > > There was a Lighthouse ticket for the 1.2.7 and 1.3.3 branches which
> > > has supposedly fixed the issue for 
> > > some:http://cakephp.lighthouseapp.com/projects/42648/tickets/882-regressio...
>
> > > ...but not all.
>
> > > It may be related to server configuration and (PHP?) server settings.
>
> > > Two questions:
> > > 1. Any ideas of where to start looking, and what to look at?
> > > 2. Should the debug.log still log errors of code that had used the
> > > suppression character (@) ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: "Bug" with media.php CakePHP core file - HELP

2010-12-16 Thread BrendonKoz
Although I've been tempted to, I don't personally like modifying the
core unless I also try to fix the problem that made me want to modify
it in the first place (and then submit a ticket). I did a search on
the issue, and it seems that CakePHP is not the only "framework" or
project to suffer from this issue. Both Drupal and SilverStripe CMS
have had the issue as well (SilverStripe fixed it; Drupal "fixed" it
by commenting out the lines).

I would imagine the call to ob_flush() is there for a reason, and
simply removing it from the interpreter's view (commenting out) would
detract from its purpose (I'm guessing its call is assisting with
memory usage).

Unfortunately since SilverStripe CMS uses its own internal framework
that I am unfamiliar with, I was not able to figure out exactly *how*
they fixed it.

On Dec 15, 4:36 pm, euromark  wrote:
> i had my log files filled up with that crap as well
> just comment those lines out - worked for me :)
>
> On 15 Dez., 18:18, BrendonKoz  wrote:
>
> > I would like to trace down the issue I'm about to explain, but I
> > unfortunately am not sure where to look. Any advice or help would be
> > appreciated.
>
> > I am continually getting NOTICE level error messages reported to
> > debug.log from media.php:
> > 2010-12-15 11:04:50 Notice: Notice (8): ob_flush() [ > href='ref.outcontrol'>ref.outcontrol]: failed to flush buffer. No
> > buffer to flush. in [/home/sspl/cake/libs/view/media.php, line 283]
>
> >  ACTUAL LINES 
> > function _flushBuffer() {
> >         @flush();
> >         @ob_flush();    // <-- error here}
>
> > 
>
> > Due to execution time looping (depending on the size of the file being
> > served and the buffer), this notice can be (and is) repeated multiple
> > times. This causes the debug.log file (on default core.php logging
> > settings) to increase in size *very* rapidly. (I have since modified
> > my core.php file to use E_ALL ^ E_NOTICE to prevent the file growth,
> > but this is only a band-aid solution.)
>
> > I have found two other CakePHP users that have mentioned the problem:
> > 1.http://groups.google.com/group/cake-php/browse_thread/thread/65f03d0c...
> > 2.http://groups.google.com/group/cake-php/browse_thread/thread/7b6ec1c1...
>
> > There was a Lighthouse ticket for the 1.2.7 and 1.3.3 branches which
> > has supposedly fixed the issue for 
> > some:http://cakephp.lighthouseapp.com/projects/42648/tickets/882-regressio...
>
> > ...but not all.
>
> > It may be related to server configuration and (PHP?) server settings.
>
> > Two questions:
> > 1. Any ideas of where to start looking, and what to look at?
> > 2. Should the debug.log still log errors of code that had used the
> > suppression character (@) ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: "Bug" with media.php CakePHP core file - HELP

2010-12-15 Thread euromark
i had my log files filled up with that crap as well
just comment those lines out - worked for me :)

On 15 Dez., 18:18, BrendonKoz  wrote:
> I would like to trace down the issue I'm about to explain, but I
> unfortunately am not sure where to look. Any advice or help would be
> appreciated.
>
> I am continually getting NOTICE level error messages reported to
> debug.log from media.php:
> 2010-12-15 11:04:50 Notice: Notice (8): ob_flush() [ href='ref.outcontrol'>ref.outcontrol]: failed to flush buffer. No
> buffer to flush. in [/home/sspl/cake/libs/view/media.php, line 283]
>
>  ACTUAL LINES 
> function _flushBuffer() {
>         @flush();
>         @ob_flush();    // <-- error here}
>
> 
>
> Due to execution time looping (depending on the size of the file being
> served and the buffer), this notice can be (and is) repeated multiple
> times. This causes the debug.log file (on default core.php logging
> settings) to increase in size *very* rapidly. (I have since modified
> my core.php file to use E_ALL ^ E_NOTICE to prevent the file growth,
> but this is only a band-aid solution.)
>
> I have found two other CakePHP users that have mentioned the problem:
> 1.http://groups.google.com/group/cake-php/browse_thread/thread/65f03d0c...
> 2.http://groups.google.com/group/cake-php/browse_thread/thread/7b6ec1c1...
>
> There was a Lighthouse ticket for the 1.2.7 and 1.3.3 branches which
> has supposedly fixed the issue for 
> some:http://cakephp.lighthouseapp.com/projects/42648/tickets/882-regressio...
>
> ...but not all.
>
> It may be related to server configuration and (PHP?) server settings.
>
> Two questions:
> 1. Any ideas of where to start looking, and what to look at?
> 2. Should the debug.log still log errors of code that had used the
> suppression character (@) ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: bug with HTML entity encoding of attribute of form elements

2010-08-06 Thread Dan Heberden
As for the quotes thing - i meant sending the slash along with it, so
the rendered, parse, printed, whatever text would _look_ like

onclick="function(\"xxx\");"   more or less a work around

I agree that it needs to be something specific.. I think escape needs
to be mixed - that way it would be backwards compatible..

echo $this->Form->button('', array('onClick' =>
'function(\'xxx
\')', 'escape' => true));

would still work OR

echo $this->Form->button('', array('onClick' =>
'function(\'xxx
\')', 'escape' => array('name') ));

To specify WHAT gets escaped.  - if array, defaults to false for all
others.

Kind of like containable does..




On Aug 6, 4:28 am, drbuzasi  wrote:
> Of course i mean at my first question: ...different options for title/
> selectoptions and for attributes in future versions...
>
> On aug. 6, 13:21, drbuzasi  wrote:
>
>
>
> > I think that's not a problem of php escaping. Using double quotes in
> > javascript isn't a good idea since the code generated (assuming it
> > won't be escaped) would be
> > ... onChange="functon("yyy")"...
> > which is meanless because of the wrapping double quotes.
>
> > IMHO the problem is in form.php and helper.php.
>
> > Button problem:
> > If 'escape' is set true as option in form.php (CakePHP 1.3.3) line
> > 1266 makes title escaped. After then the option remains causing
> > attributes getting escaped as well calling _parseAttributes at line
> > 1271.
> > So title AND attributes will be encoded if 'escape'=>true but none of
> > them while set ti false.
>
> > Select (and $form->input generally) problem:
> > Setting 'escape'=>true HTML encodes only select options because line
> > 1426 saves the value for line 1498 but line 1427 unsets this option.
> > So when calling _parseAttribute at line 1475 this option is not
> > present causing use of default value at line 336 in helper.php.
> > Select attributes will be ALWAYS encoded.
>
> > Question:
> > Should be used different escape options for title/selectoptions in
> > future versions of CakePHP? Or the default value in helper.php line
> > 336 should be set tu false?
>
> > On aug. 6, 06:35, Dan Heberden  wrote:
>
> > > Does changing your quote pattern help?
>
> > > echo $this->Form->select('field', array( '1' => '' , '2' =>
> > > '' ),
> > >                                           null, array('onChange' =>
> > > 'function(\"yyy\")'));
>
> > > \" (because php isn't escaping it) will get sent to the output, which
> > > _should_ render
>
> > > onclick="function(\"yyy\")" -
>
> > > I would do some more tests with sending double quotes vs single quotes
> > > for the ent_quote option of the $form helper..
>
> > > On Aug 5, 5:27 pm, drbuzasi  wrote:
>
> > > > If a button is needed that is labeled as '' and has an
> > > > 'onClick' attribute with some javascript containing a text parameter
> > > > the code can't be created since when 'escape' is set to false in
> > > > options (button default) the script is OK but buttons label will not
> > > > be encoded.
> > > > Setting 'escape' to true HTML encodes my script, too, which is wrong.
>
> > > > echo $this->Form->button('', array('onClick => 'function(\'xxx
> > > > \')'));
> > > > results
> > > > 
>
> > > > echo $this->Form->button('', array('onClick' => 'function(\'xxx
> > > > \')', 'escape' => true));
> > > > results
> > > >  > > > onClick="function('xxx')">

Re: bug with HTML entity encoding of attribute of form elements

2010-08-06 Thread drbuzasi
Of course i mean at my first question: ...different options for title/
selectoptions and for attributes in future versions...


On aug. 6, 13:21, drbuzasi  wrote:
> I think that's not a problem of php escaping. Using double quotes in
> javascript isn't a good idea since the code generated (assuming it
> won't be escaped) would be
> ... onChange="functon("yyy")"...
> which is meanless because of the wrapping double quotes.
>
> IMHO the problem is in form.php and helper.php.
>
> Button problem:
> If 'escape' is set true as option in form.php (CakePHP 1.3.3) line
> 1266 makes title escaped. After then the option remains causing
> attributes getting escaped as well calling _parseAttributes at line
> 1271.
> So title AND attributes will be encoded if 'escape'=>true but none of
> them while set ti false.
>
> Select (and $form->input generally) problem:
> Setting 'escape'=>true HTML encodes only select options because line
> 1426 saves the value for line 1498 but line 1427 unsets this option.
> So when calling _parseAttribute at line 1475 this option is not
> present causing use of default value at line 336 in helper.php.
> Select attributes will be ALWAYS encoded.
>
> Question:
> Should be used different escape options for title/selectoptions in
> future versions of CakePHP? Or the default value in helper.php line
> 336 should be set tu false?
>
> On aug. 6, 06:35, Dan Heberden  wrote:
>
> > Does changing your quote pattern help?
>
> > echo $this->Form->select('field', array( '1' => '' , '2' =>
> > '' ),
> >                                           null, array('onChange' =>
> > 'function(\"yyy\")'));
>
> > \" (because php isn't escaping it) will get sent to the output, which
> > _should_ render
>
> > onclick="function(\"yyy\")" -
>
> > I would do some more tests with sending double quotes vs single quotes
> > for the ent_quote option of the $form helper..
>
> > On Aug 5, 5:27 pm, drbuzasi  wrote:
>
> > > If a button is needed that is labeled as '' and has an
> > > 'onClick' attribute with some javascript containing a text parameter
> > > the code can't be created since when 'escape' is set to false in
> > > options (button default) the script is OK but buttons label will not
> > > be encoded.
> > > Setting 'escape' to true HTML encodes my script, too, which is wrong.
>
> > > echo $this->Form->button('', array('onClick => 'function(\'xxx
> > > \')'));
> > > results
> > > 
>
> > > echo $this->Form->button('', array('onClick' => 'function(\'xxx
> > > \')', 'escape' => true));
> > > results
> > >  > > onClick="function('xxx')">

Re: bug with HTML entity encoding of attribute of form elements

2010-08-06 Thread drbuzasi
I think that's not a problem of php escaping. Using double quotes in
javascript isn't a good idea since the code generated (assuming it
won't be escaped) would be
... onChange="functon("yyy")"...
which is meanless because of the wrapping double quotes.

IMHO the problem is in form.php and helper.php.

Button problem:
If 'escape' is set true as option in form.php (CakePHP 1.3.3) line
1266 makes title escaped. After then the option remains causing
attributes getting escaped as well calling _parseAttributes at line
1271.
So title AND attributes will be encoded if 'escape'=>true but none of
them while set ti false.

Select (and $form->input generally) problem:
Setting 'escape'=>true HTML encodes only select options because line
1426 saves the value for line 1498 but line 1427 unsets this option.
So when calling _parseAttribute at line 1475 this option is not
present causing use of default value at line 336 in helper.php.
Select attributes will be ALWAYS encoded.

Question:
Should be used different escape options for title/selectoptions in
future versions of CakePHP? Or the default value in helper.php line
336 should be set tu false?

On aug. 6, 06:35, Dan Heberden  wrote:
> Does changing your quote pattern help?
>
> echo $this->Form->select('field', array( '1' => '' , '2' =>
> '' ),
>                                           null, array('onChange' =>
> 'function(\"yyy\")'));
>
> \" (because php isn't escaping it) will get sent to the output, which
> _should_ render
>
> onclick="function(\"yyy\")" -
>
> I would do some more tests with sending double quotes vs single quotes
> for the ent_quote option of the $form helper..
>
> On Aug 5, 5:27 pm, drbuzasi  wrote:
>
> > If a button is needed that is labeled as '' and has an
> > 'onClick' attribute with some javascript containing a text parameter
> > the code can't be created since when 'escape' is set to false in
> > options (button default) the script is OK but buttons label will not
> > be encoded.
> > Setting 'escape' to true HTML encodes my script, too, which is wrong.
>
> > echo $this->Form->button('', array('onClick => 'function(\'xxx
> > \')'));
> > results
> > 
>
> > echo $this->Form->button('', array('onClick' => 'function(\'xxx
> > \')', 'escape' => true));
> > results
> >  > onClick="function('xxx')">

Re: bug with HTML entity encoding of attribute of form elements

2010-08-05 Thread Dan Heberden
Does changing your quote pattern help?

echo $this->Form->select('field', array( '1' => '' , '2' =>
'' ),
  null, array('onChange' =>
'function(\"yyy\")'));

\" (because php isn't escaping it) will get sent to the output, which
_should_ render

onclick="function(\"yyy\")" -

I would do some more tests with sending double quotes vs single quotes
for the ent_quote option of the $form helper..



On Aug 5, 5:27 pm, drbuzasi  wrote:
> If a button is needed that is labeled as '' and has an
> 'onClick' attribute with some javascript containing a text parameter
> the code can't be created since when 'escape' is set to false in
> options (button default) the script is OK but buttons label will not
> be encoded.
> Setting 'escape' to true HTML encodes my script, too, which is wrong.
>
> echo $this->Form->button('', array('onClick => 'function(\'xxx
> \')'));
> results
> 
>
> echo $this->Form->button('', array('onClick' => 'function(\'xxx
> \')', 'escape' => true));
> results
>  onClick="function('xxx')">

Re: Bug getLastInsertID( )

2010-07-28 Thread Davor Ilic
thanks i will check this because i used the alternate mysql_insert_id()

2010/7/29 Norman Paniagua 

> when you save a record the id is stored in the model.. like
>
> $this->Model->save()
> $this->Model->id() // Get the current ID of the inserted record
> ---
>
> Norman Paniagua
>
>
> 2010/7/28 Davor Ilic 
>
>>  i can´t use getLastInsertID( 
>> )<#12a1bf4bf8f0d581_12a1bce91255532a_method-ModelgetLastInsertID> does
>> anybody use this and it works for him?
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Bug getLastInsertID( )

2010-07-28 Thread Norman Paniagua
when you save a record the id is stored in the model.. like

$this->Model->save()
$this->Model->id() // Get the current ID of the inserted record
---

Norman Paniagua


2010/7/28 Davor Ilic 

> i can´t use getLastInsertID( )<#12a1bce91255532a_method-ModelgetLastInsertID> 
> does
> anybody use this and it works for him?
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en


Re: Bug report: CakePHP saving twice

2009-10-21 Thread AD7six



On 21 oct, 07:59, "Ma'moon"  wrote:
> You may want to open a ticket @https://trac.cakephp.org/stating the steps
> to reproduce your claims so that the core DEVs may review it and fix it.

That's pretty bad advice - why should cake devs bother filtering
through user-land problems of this nature?

First identify why it's saving twice - there are enough clues in the
OP to guess it has nothing to do with cake at all:

1) Users clicks a link going to /some/url/
2) Due to not-really-using-cake, when the page is loaded there's also
a request for /some/url/js/jquery-1.3.2.min.js
3) The action that both of these urls hits - is saving to the
database.

Rawna - if that's not your problem it's going to be something very
similar. your layout code should include: $javascript->link
('jquery-1.3.2.min.js');

some useful debugging tips/examples:

// anywhere
debug(Debugger::trace());

// in your controller - app controller beforeFilter's a good place
$this->log($this->here);
$this->log($this->referer());
$this->log($this->data);
$this->log($this->params);

 // in your model - to find out why 'field' is being saved empty
function beforeSave() {
if (empty($this->data[$this->alias]['field'])) {
debug ($this->data);
debug(Debugger::trace()); die;
}
return true;
}

Other things probably relevant:
use cake [helpers]
get requests shouldn't do anything 
http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods
if you're using requestAction at all - try not to.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug report: CakePHP saving twice

2009-10-21 Thread AD7six



On 21 oct, 06:32, Rawna  wrote:
> I just found out that CakePHP saving twice when I have warnings (as I
> saw it in debug.log)
> E.g. I have $this->Model->save() in my controller
>
> And I have this in my default.ctp template:
> 
>
> I think CakePHP is going through the controller action again when a
> warning caused by the above is present.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug report: CakePHP saving twice

2009-10-21 Thread Dr. Loboto

"Going twice" may occur because of requestAction somewhere.

On Oct 21, 11:32 am, Rawna  wrote:
> I just found out that CakePHP saving twice when I have warnings (as I
> saw it in debug.log)
> E.g. I have $this->Model->save() in my controller
>
> And I have this in my default.ctp template:
> 
>
> I think CakePHP is going through the controller action again when a
> warning caused by the above is present.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug report: CakePHP saving twice

2009-10-20 Thread Ma'moon
You may want to open a ticket @ https://trac.cakephp.org/ stating the steps
to reproduce your claims so that the core DEVs may review it and fix it.

On Wed, Oct 21, 2009 at 12:32 AM, Rawna  wrote:

>
> I just found out that CakePHP saving twice when I have warnings (as I
> saw it in debug.log)
> E.g. I have $this->Model->save() in my controller
>
> And I have this in my default.ctp template:
> 
>
> I think CakePHP is going through the controller action again when a
> warning caused by the above is present.
> >
>


-- 
http://phpirate.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - Accessing Deep Model Relations In Plugins

2009-10-06 Thread Cody Lundquist
Mark,

Thanks so much for the help! That brought my plugin to life and caused tons
of errors hahaha.  I ended up setting $this->recursive = '-1' in my
CmsAppModel (like I've been recommended to do in some articles I've read)
and only set the recursive to 1+ if I need to.

Now if only a plugin could have it's own set of plugins as well...I would be
a happy camper!

Best Regards,
cody


"Pneumonoultramicroscopicsilicovolcanoconiosis is a
floccinaucinihilipilificated word."



On Wed, Oct 7, 2009 at 10:43 AM, mark_story  wrote:

>
> Your associations are wrong.
>
> var $hasMany = 'CmsTemplate'; will never work.
>
> var $hasMany = array('Cms.CmsTemplate');
> or
> var $hasMany = array('CmsTemplate' => array('className' =>
> 'Cms.CmsTemplate'));
>
> will probably work much better.  You're missing the plugin prefix on
> your plugin model associations.
>
> -Mark
>
> On Oct 6, 4:34 pm, MeanStudios  wrote:
> > Nope, containable isn't working either. The following code (I'm now
> > including my prefixes for my plugin.  The name of my plugin is Cms):
> >
> > $this->CmsPage->CmsLayout->Behaviors->attach('Containable');
> > $this->CmsPage->CmsLayout->contain('CmsTemplate');
> > debug($this->CmsPage->CmsLayout->findById($id));
> > exit;
> >
> > Produces this error:
> > Warning (512): Model "CmsLayout" is not associated with model
> > "CmsTemplate" [CORE/cake/libs/model/behaviors/containable.php, line
> > 340]
> >
> > In my cms_templates table, there is a field called cms_layout_id so
> > this should work.
> > In my models I have $hasMany = 'CmsTemplate' for CmsLayout.php and
> > $belongsTo = 'CmsLayout' in my CmsTemplate.php.
> >
> > Any thoughts?
> >
> > On Oct 7, 4:15 am, brian  wrote:
> >
> >
> >
> > > On Mon, Oct 5, 2009 at 8:45 PM, MeanStudios 
> wrote:
> >
> > > > Greetings,
> >
> > > > I'm not sure if this is a bug or not but here it goes. If I have 3
> > > > models (Layout, Template, Page).  Layout has many Page and Template.
> > > > Page and Template have only one Layout.  If I am in the
> > > > PagesController and I do something like $this->Page->Layout->findById
> > > > ($id) it should return an array with with Layout data as well as all
> > > > the templates and pages that are related to the passed layout id,
> > > > correct?  Well it's not.  The only way I can get that data is if I do
> > > > a bind right before the findById() like so
> > > > $this->Page->Layout->bindModel(array('hasMany' => array('Template' =>
> > > > array('className' => 'Template';
> > > > $this->Page->Layout->findById($id);
> >
> > > > That will return an array of the Layout Data as well as an array of
> > > > all the templates that Layout has associated to it.
> >
> > > > Yes, my $hasMany and $belongsTo definitions are setup correctly
> > > > because I can go into the LayoutsController and just do:
> > > > $this->Layout->findById($id);
> > > > and it will return all the data it's supposed to.
> >
> > > > Yes I am using prefixes for my plugin controllers, models, views,
> > > > etc.  It's just less confusing if I don't do it here.
> >
> > > > I'm pretty sure that I don't need the bind when not working inside a
> > > > template but inside a regular controller.
> >
> > > If the associations are correct, that would seem odd. Can you try it
> > > using Containable?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - Accessing Deep Model Relations In Plugins

2009-10-06 Thread mark_story

Your associations are wrong.

var $hasMany = 'CmsTemplate'; will never work.

var $hasMany = array('Cms.CmsTemplate');
or
var $hasMany = array('CmsTemplate' => array('className' =>
'Cms.CmsTemplate'));

will probably work much better.  You're missing the plugin prefix on
your plugin model associations.

-Mark

On Oct 6, 4:34 pm, MeanStudios  wrote:
> Nope, containable isn't working either. The following code (I'm now
> including my prefixes for my plugin.  The name of my plugin is Cms):
>
> $this->CmsPage->CmsLayout->Behaviors->attach('Containable');
> $this->CmsPage->CmsLayout->contain('CmsTemplate');
> debug($this->CmsPage->CmsLayout->findById($id));
> exit;
>
> Produces this error:
> Warning (512): Model "CmsLayout" is not associated with model
> "CmsTemplate" [CORE/cake/libs/model/behaviors/containable.php, line
> 340]
>
> In my cms_templates table, there is a field called cms_layout_id so
> this should work.
> In my models I have $hasMany = 'CmsTemplate' for CmsLayout.php and
> $belongsTo = 'CmsLayout' in my CmsTemplate.php.
>
> Any thoughts?
>
> On Oct 7, 4:15 am, brian  wrote:
>
>
>
> > On Mon, Oct 5, 2009 at 8:45 PM, MeanStudios  
> > wrote:
>
> > > Greetings,
>
> > > I'm not sure if this is a bug or not but here it goes. If I have 3
> > > models (Layout, Template, Page).  Layout has many Page and Template.
> > > Page and Template have only one Layout.  If I am in the
> > > PagesController and I do something like $this->Page->Layout->findById
> > > ($id) it should return an array with with Layout data as well as all
> > > the templates and pages that are related to the passed layout id,
> > > correct?  Well it's not.  The only way I can get that data is if I do
> > > a bind right before the findById() like so
> > > $this->Page->Layout->bindModel(array('hasMany' => array('Template' =>
> > > array('className' => 'Template';
> > > $this->Page->Layout->findById($id);
>
> > > That will return an array of the Layout Data as well as an array of
> > > all the templates that Layout has associated to it.
>
> > > Yes, my $hasMany and $belongsTo definitions are setup correctly
> > > because I can go into the LayoutsController and just do:
> > > $this->Layout->findById($id);
> > > and it will return all the data it's supposed to.
>
> > > Yes I am using prefixes for my plugin controllers, models, views,
> > > etc.  It's just less confusing if I don't do it here.
>
> > > I'm pretty sure that I don't need the bind when not working inside a
> > > template but inside a regular controller.
>
> > If the associations are correct, that would seem odd. Can you try it
> > using Containable?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - Accessing Deep Model Relations In Plugins

2009-10-06 Thread MeanStudios

Nope, containable isn't working either. The following code (I'm now
including my prefixes for my plugin.  The name of my plugin is Cms):

$this->CmsPage->CmsLayout->Behaviors->attach('Containable');
$this->CmsPage->CmsLayout->contain('CmsTemplate');
debug($this->CmsPage->CmsLayout->findById($id));
exit;

Produces this error:
Warning (512): Model "CmsLayout" is not associated with model
"CmsTemplate" [CORE/cake/libs/model/behaviors/containable.php, line
340]

In my cms_templates table, there is a field called cms_layout_id so
this should work.
In my models I have $hasMany = 'CmsTemplate' for CmsLayout.php and
$belongsTo = 'CmsLayout' in my CmsTemplate.php.

Any thoughts?

On Oct 7, 4:15 am, brian  wrote:
> On Mon, Oct 5, 2009 at 8:45 PM, MeanStudios  wrote:
>
> > Greetings,
>
> > I'm not sure if this is a bug or not but here it goes. If I have 3
> > models (Layout, Template, Page).  Layout has many Page and Template.
> > Page and Template have only one Layout.  If I am in the
> > PagesController and I do something like $this->Page->Layout->findById
> > ($id) it should return an array with with Layout data as well as all
> > the templates and pages that are related to the passed layout id,
> > correct?  Well it's not.  The only way I can get that data is if I do
> > a bind right before the findById() like so
> > $this->Page->Layout->bindModel(array('hasMany' => array('Template' =>
> > array('className' => 'Template';
> > $this->Page->Layout->findById($id);
>
> > That will return an array of the Layout Data as well as an array of
> > all the templates that Layout has associated to it.
>
> > Yes, my $hasMany and $belongsTo definitions are setup correctly
> > because I can go into the LayoutsController and just do:
> > $this->Layout->findById($id);
> > and it will return all the data it's supposed to.
>
> > Yes I am using prefixes for my plugin controllers, models, views,
> > etc.  It's just less confusing if I don't do it here.
>
> > I'm pretty sure that I don't need the bind when not working inside a
> > template but inside a regular controller.
>
> If the associations are correct, that would seem odd. Can you try it
> using Containable?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - Accessing Deep Model Relations In Plugins

2009-10-06 Thread brian

On Mon, Oct 5, 2009 at 8:45 PM, MeanStudios  wrote:
>
> Greetings,
>
> I'm not sure if this is a bug or not but here it goes. If I have 3
> models (Layout, Template, Page).  Layout has many Page and Template.
> Page and Template have only one Layout.  If I am in the
> PagesController and I do something like $this->Page->Layout->findById
> ($id) it should return an array with with Layout data as well as all
> the templates and pages that are related to the passed layout id,
> correct?  Well it's not.  The only way I can get that data is if I do
> a bind right before the findById() like so
> $this->Page->Layout->bindModel(array('hasMany' => array('Template' =>
> array('className' => 'Template';
> $this->Page->Layout->findById($id);
>
> That will return an array of the Layout Data as well as an array of
> all the templates that Layout has associated to it.
>
> Yes, my $hasMany and $belongsTo definitions are setup correctly
> because I can go into the LayoutsController and just do:
> $this->Layout->findById($id);
> and it will return all the data it's supposed to.
>
> Yes I am using prefixes for my plugin controllers, models, views,
> etc.  It's just less confusing if I don't do it here.
>
> I'm pretty sure that I don't need the bind when not working inside a
> template but inside a regular controller.

If the associations are correct, that would seem odd. Can you try it
using Containable?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug?

2009-09-15 Thread Dr. Loboto

1. To not receive empty records in DB you should also set fields there
to NOT NULL
2. To make cake validate not only actual POST values but all fields
that must be, you need more complex validation:
 var $validate = array(
  'username' => array(
'rule' => 'alphaNumeric',
'required' => true
  ),
  'password' => array(
'rule' => 'notEmpty',
'required' => true
  ),
  'name' => array(
'rule' => 'notEmpty',
'required' => true
  ),
  'email' => array(
'rule' => 'email',
'required' => true
  )
);

On Sep 15, 6:52 pm, Vladiq  wrote:
>   UNIQUE KEY `username` (`username`),
>   UNIQUE KEY `email` (`email`,`username`),
>
> You right.
>
> But why validation doesn't work?
>
> On 15 сен, 14:48, Martin Westin  wrote:
>
>
>
> > If you really did set "username, email to unique" and not "username
> > unique and email unique" (see the difference?) all is as it should be.
> > In the first instance (one index combining the two fields) would have
> > to have the same username and email combination for MySQLs index to
> > throw an error.
>
> > Is that it, you think?
>
> > /Martin
>
> > On Sep 15, 12:28 pm, "vla...@gmail.com"  wrote:
>
> > > Cake PHP 1.2.5, MySQL 5.*
>
> > > What I have:
>
> > > model user (all default) and:
>
> > >  var $validate = array(
> > >           'username' => 'alphaNumeric',
> > >           'password' => 'notEmpty',
> > >           'name' => 'notEmpty',
> > >           'email' => 'email',
> > >         );
>
> > > In MySQL I set for this table (users) fields: username, email - unique
>
> > > Also add Security component for security ;-)
>
> > > Now, I add ticket component for password remainding. And make a
> > > mistake:
>
> > > /users/remind.ctp:
>
> > > 
> > > create('User');?>
> > >          > >                 echo $form->input('email');
> > >         ?>
> > > end('Submit');?>
> > > 
>
> > > As you see form->create - I generate form /users/add
>
> > > So. I write in one field my email (already present in DB) and got
> > > message "User was added"
>
> > > I don't believe it. But in Mysql table I see record with email (which
> > > was present second time!) and other empty fields.
>
> > > How it possible???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug?

2009-09-15 Thread Vladiq

  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`,`username`),

You right.

But why validation doesn't work?

On 15 сен, 14:48, Martin Westin  wrote:
> If you really did set "username, email to unique" and not "username
> unique and email unique" (see the difference?) all is as it should be.
> In the first instance (one index combining the two fields) would have
> to have the same username and email combination for MySQLs index to
> throw an error.
>
> Is that it, you think?
>
> /Martin
>
> On Sep 15, 12:28 pm, "vla...@gmail.com"  wrote:
>
>
>
> > Cake PHP 1.2.5, MySQL 5.*
>
> > What I have:
>
> > model user (all default) and:
>
> >  var $validate = array(
> >           'username' => 'alphaNumeric',
> >           'password' => 'notEmpty',
> >           'name' => 'notEmpty',
> >           'email' => 'email',
> >         );
>
> > In MySQL I set for this table (users) fields: username, email - unique
>
> > Also add Security component for security ;-)
>
> > Now, I add ticket component for password remainding. And make a
> > mistake:
>
> > /users/remind.ctp:
>
> > 
> > create('User');?>
> >          >                 echo $form->input('email');
> >         ?>
> > end('Submit');?>
> > 
>
> > As you see form->create - I generate form /users/add
>
> > So. I write in one field my email (already present in DB) and got
> > message "User was added"
>
> > I don't believe it. But in Mysql table I see record with email (which
> > was present second time!) and other empty fields.
>
> > How it possible???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug?

2009-09-15 Thread Martin Westin


If you really did set "username, email to unique" and not "username
unique and email unique" (see the difference?) all is as it should be.
In the first instance (one index combining the two fields) would have
to have the same username and email combination for MySQLs index to
throw an error.

Is that it, you think?

/Martin



On Sep 15, 12:28 pm, "vla...@gmail.com"  wrote:
> Cake PHP 1.2.5, MySQL 5.*
>
> What I have:
>
> model user (all default) and:
>
>  var $validate = array(
>           'username' => 'alphaNumeric',
>           'password' => 'notEmpty',
>           'name' => 'notEmpty',
>           'email' => 'email',
>         );
>
> In MySQL I set for this table (users) fields: username, email - unique
>
> Also add Security component for security ;-)
>
> Now, I add ticket component for password remainding. And make a
> mistake:
>
> /users/remind.ctp:
>
> 
> create('User');?>
>                          echo $form->input('email');
>         ?>
> end('Submit');?>
> 
>
> As you see form->create - I generate form /users/add
>
> So. I write in one field my email (already present in DB) and got
> message "User was added"
>
> I don't believe it. But in Mysql table I see record with email (which
> was present second time!) and other empty fields.
>
> How it possible???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug? $html->addCrumb()

2009-07-29 Thread leop

What I am saying is that each time I view another page, the $html-
>_crumbs array is redeclared. There is no trail of crumbs for Hansel
and Gretel to follow, only the last one they dropped.

I have used this before with great success, but not now.

I want (and expect) something like:
companies>>view>>edit

Whereas what I get is:
companies

then:
view

then:
edit

Leo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug? $html->addCrumb()

2009-07-28 Thread tobi_one

Hi,

I'm not sure I got your question right, but are you wondering that the
array starts empty with each page? If so, this is not a bug but a
feature. To add trails you will have to call addCrumb several times. I
also described this here:

http://www.tobman.com/blog/using-breadcrumbs-with-cakephp/

Cheers,
tobi_one

On Jul 28, 4:01 pm, leo  wrote:
> As this worked in an earlier release, and nobody has responded to my
> previous post, I'm wondering if this is maybe a bug. If so, I'll log
> it.
>
> Some time ago I used the bread crumb functionality of HtmlHelper
> without a great deal of difficulty.
>
> Now, a year or so on, I'm at it again. This time I'm developing in a
> full release: 1.2.3.8166 (previously it was RC2 or RC3) and it doesn't
> seem to
> work. I don't have access to my previous code for reference.
>
> The symptoms are that when I addCrumb, the $html->_crumbs array
> appears to be created afresh for each page visited. The crumbs array
> seems to be going out of
> scope.
>
> The following code fragment from an_element.ctp which is included by
> the layout, default.ctp:
>
> debug($html->_crumbs);
>         $html->addCrumb($this->name,$this->params['url']['url']);
> debug($html->_crumbs);
>
> always yields this, or similar, output as the site is navigated, i.e.
> an array with 0 or 1 elements:
>
> Array
> (
> )
>
> Array
> (
>     [0] => Array
>         (
>             [0] => Proposals
>             [1] => proposals/view/5
>             [2] =>
>         )
>
> )
>
> I'm a bit confused here and would appreciate any pointers to what I'm
> failing to do.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-08 Thread Martin Westin

If you are querying Category you specify the order for Catrgory in the
find, using order like normal. The SubCategory data will (should) use
the order specified in the relationship written in the Category model
and the order for Item should by default be what is defined in
SubCategory.

Using Containable you can override this by specifying order keys for
each associated Model set to be retrieved.
Something like:
'contain' => array(
'SubCategory' => array(
'order' => 'SubCategory.title ASC',
'Item' => array(
'order' => 'Item.name ASC'
)
)
)




On Jun 8, 11:10 am, fain182  wrote:
> > Another hint:
> > When the data is not joined you can also do "dynamic" ordering on the
> > related data (not the primary data by the related values though) using
> > Containable Behaviour.
>
> i have model like this:
> category hasmany subcategory hasmany items..
> i want to order items by category and subcategory, using the order in
> the relationship, it works only for the category.. for example
> cat A : subcat 3, subcat 4
> cat B: subcat 1, subcat 2, subcat 5
>
> i want a view with:
> Cat A:
> subcat 3
>    his items..
> subcat 4
>    his items..
> Cat B:
> subcat 1
>    his items..
> subcat 2
>    his items..
> subcat 5
>    his items..
>
> but using order in the relation i have:
>
> Cat B
> subcat 1
>    his items..
> subcat 2
>    his items..
> Cat A
> subcat 3
>    his items..
> subcat 4
>    his items..
> Cat B
> subcat 5
>    his items..
>
> i should bind and unbind? how?
>
> --
> pietro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-08 Thread fain182

> Another hint:
> When the data is not joined you can also do "dynamic" ordering on the
> related data (not the primary data by the related values though) using
> Containable Behaviour.
i have model like this:
category hasmany subcategory hasmany items..
i want to order items by category and subcategory, using the order in
the relationship, it works only for the category.. for example
cat A : subcat 3, subcat 4
cat B: subcat 1, subcat 2, subcat 5

i want a view with:
Cat A:
subcat 3
   his items..
subcat 4
   his items..
Cat B:
subcat 1
   his items..
subcat 2
   his items..
subcat 5
   his items..

but using order in the relation i have:

Cat B
subcat 1
   his items..
subcat 2
   his items..
Cat A
subcat 3
   his items..
subcat 4
   his items..
Cat B
subcat 5
   his items..


i should bind and unbind? how?

-- 
pietro

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-08 Thread Martin Westin

Another hint:
When the data is not joined you can also do "dynamic" ordering on the
related data (not the primary data by the related values though) using
Containable Behaviour.




On Jun 7, 10:04 pm, fain182  wrote:
> > In your Sito model, set your default sort order like so:
>
> >    var $belongsTo = array(
> >        'Stato' => array(
> >            'order' => 'Stato.stato ASC',
> >        ));
>
> great solution!
> thank you
>
> --
> pietro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-07 Thread fain182

> In your Sito model, set your default sort order like so:
>
>    var $belongsTo = array(
>        'Stato' => array(
>            'order' => 'Stato.stato ASC',
>        ));
>
great solution!
thank you

-- 
pietro

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-07 Thread NOSLOW

No, you cannot order by related field in a find statement. You can,
however, set a default order clause on related data inside the Models.
If you need to vary that default join order, you'll need to
dynamically unbindModel, then bindModel with the new desired sort
order.

In your Sito model, set your default sort order like so:

var $belongsTo = array(
'Stato' => array(
'order' => 'Stato.stato ASC',
));

HTH.

On Jun 6, 6:48 am, fain182  wrote:
> no one knows?
> is it not important?
>
> --
> pietro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-06 Thread fain182

no one knows?
is it not important?

-- 
pietro

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-05 Thread fain182

good advice
>>                 $param = array('order'=>array('Stato.stato', 'Sito.sito'));
http://bin.cakephp.org/view/1228674051
>>               $param = array('order'=>array('Sito.sito'));
http://bin.cakephp.org/view/584859600

it seems that the data about some of the related table are added
after, it isn't a big joined table... so i'ts impossible to set an
order on Stato?

thank you
-- 
pietro

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in recursive?

2009-06-05 Thread Walther

What is your SQL debug output? You'll be able to see exactly how Cake
is building the queries and I'm sure it will answer your question.

On Jun 5, 10:10 am, fain182  wrote:
> hello, i have a simple code like this:
>
>                 $param = array('order'=>array('Stato.stato', 'Sito.sito'));
>
>                 $this->Materiale->recursive = 2;
>
>                 $this->set('materiali', $this->Materiale->find('all',
> $param));
>                 $this->render('printer', 'blank', '/materiali/printer');
>
> my relations are:
> Materiale belongsto Sito
> Sito belongsto Stato
>
> if i run the code above, it gives me error:
> SQL Error: 1054: Unknown column 'Stato.stato' in 'order clause'
>
> but with recursive = 2, this should work
>
> and if i substitute the order with:
>               $param = array('order'=>array('Sito.sito'));
>
> this doesn't give me error, and, first of all, it shows me in the view
> the Stato!
>
> it's like Stato it's included usually, but not i I use it in 'order'..
>
> some ideas?
> thank you
> --
> pietro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug? Order isn't respected when doing a cascade delete

2009-02-11 Thread AD7six



On Feb 11, 5:04 am, nebbian  wrote:
> Hi,
>
> I have the following models:
>
> class Competition extends AppModel {
>
>         var $name = 'Competition';
>         var $useTable = 'Competition';
>         var $primaryKey = 'CompetitionID';
>
>         var $recursive = 2;
>
>         var $hasMany = array(
>                         'CompetitionAnswers' => array(

^^ CompetitionAnswer""

>                                                                 'className' 
> => 'CompetitionAnswer',
>                                                                 'foreignKey' 
> => 'CompetitionID',
>                                                                 'conditions' 
> => '',
>                                                                 'fields' => 
> '',
>                                                                 'order' => 
> array('CompetitionAnswers.CompetitionID DESC',
>                                                                               
>           'CompetitionAnswers.CompetitionAnswerOrder ASC'),

^^ CompetitionAnswer"" x2

>                                                                 'dependent' 
> => true
>                         )
>         );
>
> class CompetitionAnswer extends AppModel {
>
>         var $name = 'CompetitionAnswer';
>         var $useTable = 'CompetitionAnswer';
>         var $primaryKey = 'CompetitionAnswerID';
>
>         var $recursive = 2;
>
>         var $displayField = 'CompetitionAnswerText';
>
>         var $order = array(
>                                                                         
> 'CompetitionAnswer.CompetitionID DESC',
>                                                                         
> 'CompetitionAnswer.CompetitionAnswerOrder ASC'
>                                                                 );
>
>         var $belongsTo = array(
>                         'CompetitionID' => array(

^^ Is that a typo
>                                                                 'className' 
> => 'Competition',
>                                                                 'foreignKey' 
> => 'CompetitionID',
>                                                                 'conditions' 
> => '',
>                                                                 'fields' => 
> '',
>                                                                 'order' => ''
>                         )
>         );
>
> Everything works fine, until I try a cascade delete:
>                 if ($this->Competition->del($id)) { ...
>
> When I get the following error:
>
> SQL Error: 1109: Unknown table 'CompetitionAnswer' in order clause
> [CORE/cake/libs/model/datasources/dbo_source.php, line 512]

>From the errors in your model file that's to be expected.
>
> "SELECT `CompetitionAnswers`.`CompetitionAnswerID` FROM
> `CompetitionAnswer` AS `CompetitionAnswers`   WHERE
> `CompetitionAnswers`.`CompetitionID` = 21   ORDER BY
> `CompetitionAnswer`.`CompetitionID` DESC[...]"
>
> It appears as if this is not loading the order field that I specified
> in my HasMany clause, instead it is loading the default order field
> for my class, but still calling the table the same way that was
> specified in the HasMany clause.
>
> I can't get rid of the table specification in the order clause,
> because then I get an ambiguous table name error.
>
> Is this a bug in Cake?  It sure looks like it to me.  It only happens
> on a cascade delete, not any other form of database access.

Try again after correcting your model definitions. I hope that's a
legacy database - otherwise why have you created such a repetitive and
unconventional schema (e.g.
"CompetitionAnswer.CompetitionAnswerText")? You can and should delete
anything that is the default/following convention too.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in Debugger?

2009-01-12 Thread brian

I forgot to mention that I *did* try debugging this with the
controller's $components line commented. In fact, right now, with or
without $components available, this still gives me a truncated array:

public function add($media_type_slug = null)
{
die(Debugger::dump($this->data));

... whereas, a simple die(debug($this->data)); works as expected.

On Mon, Jan 12, 2009 at 2:59 PM, brian  wrote:
> Got it working. Unfortunately, I'm still in the dark on this. None of
> what I did to make it work explains why Debugger was repeating the
> statements. I ruled out (from the access log) the action being
> accessed more than once. And, why Debugger's dump would show nothing
> when a die(debug($this-data)) immediately before it would show the
> data.
>
> Anyway, it seems that *part* of my problem was that my component had:
>
> function init(&$controller)
> {
>$this->controller = $controller;
> }
>
> followed by:
>
> public function save($dir, $options, $filename = null)
> {
>$this->controller_data =& $this->controller->data['MYModel'];
>...
>
> I changed inti() to startup() and that seemed to fix things. I say
> "seemed" because I also did a lot of fiddling and, anyway, I can't
> figure out why just this change would resolve the problem.
>
> And, again, Debugger was *still* doing some weird things here. I wish
> I had the time to delve into this some more but I'm in the final
> stretch in this project and have to make up for a day's worth of
> hair-pulling. I'd need to learn a lot more about Cake internals before
> getting a grip on this.
>
>
> On Mon, Jan 12, 2009 at 12:16 PM, brian  wrote:
>> Thanks, but no luck. The access log doesn't show anything strange that
>> I can see. But, I still see Debugger's statements repeated a couple
>> seconds later.
>>
>> But, the strangest thing of all is this:
>>
>> public function add($media_type_slug = null)
>> {
>>die(debug($this->data));
>>die(Debugger::dump($this->data));
>>...
>>
>> This prints the data just fine. All of it is there, as I'd expect it.
>> Sadly, I have to kill the data in order to save it, as it were ;-)
>>
>> However, when I comment the first line, I get an array with only the
>> model name keys, both of which contain empty arrays, in turn. That is,
>> not even any fieldname keys.
>>
>> array(
>>"Record" => array(),
>>"Discipline" => array()
>> )
>>
>> So, unless I've missed something crucial in the docs, something's
>> quite wrong here. I'd post this to Trac but I wouldn't know where to
>> begin to write a test case for this.
>>
>> The thing is, I've no idea if they're even related. The Debugger
>> statements are not causing the data to disappear--if I comment them
>> all, I'm still left with a damaged $data array.
>>
>> You can imagine how much fun this is, given I'm SO close to putting
>> this site live :-(
>>
>>
>> On Mon, Jan 12, 2009 at 6:12 AM, grigri  wrote:
>>>
>>> Try logging the exact url that was requested each time - I had a
>>> similar problem a while ago which was due to an incorrectly formatted
>>> image tag - I just had
>>>
>>> 
>>>
>>> On the /customers/login page this would end up generating a request
>>> for
>>>
>>> `/customers/login/img/something.png`
>>>
>>> which was processed through the login action of the customers
>>> controller, resulting in the method being called twice for each page
>>> request.
>>>
>>> This was driving me nuts until I looked at the actual request logs and
>>> spotted the strange url.
>>>
>>> hth
>>> grigri
>>>
>>> On Jan 12, 6:58 am, brian  wrote:
 more: I put this immediately inside add()

 die(debug($this->data));
 Debugger::dump($this->data);

 This dumps the data--intact--onto the page. When I comment out the
 die() line, I get:

 array(
 "Record" => array(),
 "Discipline" => array()
 )

 I can't see how this possibly could be a PEBCAK situation, though I'd
 be grateful just to figure this out.

 How the heck can the data be disappearing like this?!

 I realise this probably isn't a Debugger problem and I really should
 open a new thread, but Debugger sure isn't helping, in any case. That,
 and the repeated writes to the log make me wonder. But, all the same,
 with no Debugger calls, the data still goes bye-bye.

 HELP!

 On Mon, Jan 12, 2009 at 1:35 AM, brian  wrote:
 > More on this: I put this in the controller:

 > function beforeFilter()
 > {
 >die(debug($this->data));
 > }

 > So, when I submitted the form, all the data was right where it should
 > be. (Obviously, I commented it to get the form to display). So, its
 > disappearing act comes somewhere between beforeFilter() and add().
 > I've been trying to hunt down the precise order of operations but have
 > come up empty-handed. I know that I saw it somewhere once (it'd be
 > nice if this was included in

Re: bug in Debugger?

2009-01-12 Thread brian

Got it working. Unfortunately, I'm still in the dark on this. None of
what I did to make it work explains why Debugger was repeating the
statements. I ruled out (from the access log) the action being
accessed more than once. And, why Debugger's dump would show nothing
when a die(debug($this-data)) immediately before it would show the
data.

Anyway, it seems that *part* of my problem was that my component had:

function init(&$controller)
{
$this->controller = $controller;
}

followed by:

public function save($dir, $options, $filename = null)
{
$this->controller_data =& $this->controller->data['MYModel'];
...

I changed inti() to startup() and that seemed to fix things. I say
"seemed" because I also did a lot of fiddling and, anyway, I can't
figure out why just this change would resolve the problem.

And, again, Debugger was *still* doing some weird things here. I wish
I had the time to delve into this some more but I'm in the final
stretch in this project and have to make up for a day's worth of
hair-pulling. I'd need to learn a lot more about Cake internals before
getting a grip on this.


On Mon, Jan 12, 2009 at 12:16 PM, brian  wrote:
> Thanks, but no luck. The access log doesn't show anything strange that
> I can see. But, I still see Debugger's statements repeated a couple
> seconds later.
>
> But, the strangest thing of all is this:
>
> public function add($media_type_slug = null)
> {
>die(debug($this->data));
>die(Debugger::dump($this->data));
>...
>
> This prints the data just fine. All of it is there, as I'd expect it.
> Sadly, I have to kill the data in order to save it, as it were ;-)
>
> However, when I comment the first line, I get an array with only the
> model name keys, both of which contain empty arrays, in turn. That is,
> not even any fieldname keys.
>
> array(
>"Record" => array(),
>"Discipline" => array()
> )
>
> So, unless I've missed something crucial in the docs, something's
> quite wrong here. I'd post this to Trac but I wouldn't know where to
> begin to write a test case for this.
>
> The thing is, I've no idea if they're even related. The Debugger
> statements are not causing the data to disappear--if I comment them
> all, I'm still left with a damaged $data array.
>
> You can imagine how much fun this is, given I'm SO close to putting
> this site live :-(
>
>
> On Mon, Jan 12, 2009 at 6:12 AM, grigri  wrote:
>>
>> Try logging the exact url that was requested each time - I had a
>> similar problem a while ago which was due to an incorrectly formatted
>> image tag - I just had
>>
>> 
>>
>> On the /customers/login page this would end up generating a request
>> for
>>
>> `/customers/login/img/something.png`
>>
>> which was processed through the login action of the customers
>> controller, resulting in the method being called twice for each page
>> request.
>>
>> This was driving me nuts until I looked at the actual request logs and
>> spotted the strange url.
>>
>> hth
>> grigri
>>
>> On Jan 12, 6:58 am, brian  wrote:
>>> more: I put this immediately inside add()
>>>
>>> die(debug($this->data));
>>> Debugger::dump($this->data);
>>>
>>> This dumps the data--intact--onto the page. When I comment out the
>>> die() line, I get:
>>>
>>> array(
>>> "Record" => array(),
>>> "Discipline" => array()
>>> )
>>>
>>> I can't see how this possibly could be a PEBCAK situation, though I'd
>>> be grateful just to figure this out.
>>>
>>> How the heck can the data be disappearing like this?!
>>>
>>> I realise this probably isn't a Debugger problem and I really should
>>> open a new thread, but Debugger sure isn't helping, in any case. That,
>>> and the repeated writes to the log make me wonder. But, all the same,
>>> with no Debugger calls, the data still goes bye-bye.
>>>
>>> HELP!
>>>
>>> On Mon, Jan 12, 2009 at 1:35 AM, brian  wrote:
>>> > More on this: I put this in the controller:
>>>
>>> > function beforeFilter()
>>> > {
>>> >die(debug($this->data));
>>> > }
>>>
>>> > So, when I submitted the form, all the data was right where it should
>>> > be. (Obviously, I commented it to get the form to display). So, its
>>> > disappearing act comes somewhere between beforeFilter() and add().
>>> > I've been trying to hunt down the precise order of operations but have
>>> > come up empty-handed. I know that I saw it somewhere once (it'd be
>>> > nice if this was included in the Cookbook's "A Typical CakePHP
>>> > Request" page). Is there anything between beforeFilter() and the
>>> > controller's action??
>>>
>>> > Before doing this, btw, there was no beforeFilter(). I've commented
>>> > AppController::beforeFilter(). I commented the $components array.
>>> > There's nothing in the model (nor AppModel) that would screw with the
>>> > data.
>>>
>>> > This was working earlier. Well, it was broken (it's early going) but I
>>> > could debugger::log($this->data) just fine before. I must have done
>>> > *something* to screw this 

Re: bug in Debugger?

2009-01-12 Thread brian

Thanks, but no luck. The access log doesn't show anything strange that
I can see. But, I still see Debugger's statements repeated a couple
seconds later.

But, the strangest thing of all is this:

public function add($media_type_slug = null)
{
die(debug($this->data));
die(Debugger::dump($this->data));
...

This prints the data just fine. All of it is there, as I'd expect it.
Sadly, I have to kill the data in order to save it, as it were ;-)

However, when I comment the first line, I get an array with only the
model name keys, both of which contain empty arrays, in turn. That is,
not even any fieldname keys.

array(
"Record" => array(),
"Discipline" => array()
)

So, unless I've missed something crucial in the docs, something's
quite wrong here. I'd post this to Trac but I wouldn't know where to
begin to write a test case for this.

The thing is, I've no idea if they're even related. The Debugger
statements are not causing the data to disappear--if I comment them
all, I'm still left with a damaged $data array.

You can imagine how much fun this is, given I'm SO close to putting
this site live :-(


On Mon, Jan 12, 2009 at 6:12 AM, grigri  wrote:
>
> Try logging the exact url that was requested each time - I had a
> similar problem a while ago which was due to an incorrectly formatted
> image tag - I just had
>
> 
>
> On the /customers/login page this would end up generating a request
> for
>
> `/customers/login/img/something.png`
>
> which was processed through the login action of the customers
> controller, resulting in the method being called twice for each page
> request.
>
> This was driving me nuts until I looked at the actual request logs and
> spotted the strange url.
>
> hth
> grigri
>
> On Jan 12, 6:58 am, brian  wrote:
>> more: I put this immediately inside add()
>>
>> die(debug($this->data));
>> Debugger::dump($this->data);
>>
>> This dumps the data--intact--onto the page. When I comment out the
>> die() line, I get:
>>
>> array(
>> "Record" => array(),
>> "Discipline" => array()
>> )
>>
>> I can't see how this possibly could be a PEBCAK situation, though I'd
>> be grateful just to figure this out.
>>
>> How the heck can the data be disappearing like this?!
>>
>> I realise this probably isn't a Debugger problem and I really should
>> open a new thread, but Debugger sure isn't helping, in any case. That,
>> and the repeated writes to the log make me wonder. But, all the same,
>> with no Debugger calls, the data still goes bye-bye.
>>
>> HELP!
>>
>> On Mon, Jan 12, 2009 at 1:35 AM, brian  wrote:
>> > More on this: I put this in the controller:
>>
>> > function beforeFilter()
>> > {
>> >die(debug($this->data));
>> > }
>>
>> > So, when I submitted the form, all the data was right where it should
>> > be. (Obviously, I commented it to get the form to display). So, its
>> > disappearing act comes somewhere between beforeFilter() and add().
>> > I've been trying to hunt down the precise order of operations but have
>> > come up empty-handed. I know that I saw it somewhere once (it'd be
>> > nice if this was included in the Cookbook's "A Typical CakePHP
>> > Request" page). Is there anything between beforeFilter() and the
>> > controller's action??
>>
>> > Before doing this, btw, there was no beforeFilter(). I've commented
>> > AppController::beforeFilter(). I commented the $components array.
>> > There's nothing in the model (nor AppModel) that would screw with the
>> > data.
>>
>> > This was working earlier. Well, it was broken (it's early going) but I
>> > could debugger::log($this->data) just fine before. I must have done
>> > *something* to screw this up but, after staring at it for a couple of
>> > hours now, I'm absolutely fresh out of ideas.
>>
>> > On Sun, Jan 11, 2009 at 11:40 PM, brian  wrote:
>> >> I'm trying to debug a problem with one of my controllers where
>> >> $this->data is (almost) empty (more on that in a sec) and so tossed a
>> >> bunch of Debugger::log statements in the action. When I checked the
>> >> debug.log I found that the entries are being repeated.
>>
>> >> The action starts out like this. I put several debugger statements in
>> >> because I was trying to figure out what was happening to $this->data.
>>
>> >> public function add($media_type_slug = null)
>> >> {
>> >>$this->set('user_id', $this->Session->read('User.id'));
>>
>> >>debugger::log('controller -- first');
>> >>debugger::log($this->data);
>> >>...
>> >>// more stuff, and several other Debugger::log() statements
>>
>> >> debug.log:
>>
>> >> 2009-01-11 23:17:17 Debug: "controller -- first"
>> >> 2009-01-11 23:17:17 Debug: null
>> >> 2009-01-11 23:17:19 Debug: "controller -- first"
>> >> 2009-01-11 23:17:19 Debug: null
>> >> 2009-01-11 23:17:21 Debug: "controller -- first"
>> >> 2009-01-11 23:17:21 Debug: null
>> >> 2009-01-11 23:17:50 Debug: "controller -- first"
>> >> 2009-01-11 23:17:50 Debug: array(
>> >>"

Re: bug in Debugger?

2009-01-12 Thread grigri

Try logging the exact url that was requested each time - I had a
similar problem a while ago which was due to an incorrectly formatted
image tag - I just had



On the /customers/login page this would end up generating a request
for

`/customers/login/img/something.png`

which was processed through the login action of the customers
controller, resulting in the method being called twice for each page
request.

This was driving me nuts until I looked at the actual request logs and
spotted the strange url.

hth
grigri

On Jan 12, 6:58 am, brian  wrote:
> more: I put this immediately inside add()
>
> die(debug($this->data));
> Debugger::dump($this->data);
>
> This dumps the data--intact--onto the page. When I comment out the
> die() line, I get:
>
> array(
>         "Record" => array(),
>         "Discipline" => array()
> )
>
> I can't see how this possibly could be a PEBCAK situation, though I'd
> be grateful just to figure this out.
>
> How the heck can the data be disappearing like this?!
>
> I realise this probably isn't a Debugger problem and I really should
> open a new thread, but Debugger sure isn't helping, in any case. That,
> and the repeated writes to the log make me wonder. But, all the same,
> with no Debugger calls, the data still goes bye-bye.
>
> HELP!
>
> On Mon, Jan 12, 2009 at 1:35 AM, brian  wrote:
> > More on this: I put this in the controller:
>
> > function beforeFilter()
> > {
> >    die(debug($this->data));
> > }
>
> > So, when I submitted the form, all the data was right where it should
> > be. (Obviously, I commented it to get the form to display). So, its
> > disappearing act comes somewhere between beforeFilter() and add().
> > I've been trying to hunt down the precise order of operations but have
> > come up empty-handed. I know that I saw it somewhere once (it'd be
> > nice if this was included in the Cookbook's "A Typical CakePHP
> > Request" page). Is there anything between beforeFilter() and the
> > controller's action??
>
> > Before doing this, btw, there was no beforeFilter(). I've commented
> > AppController::beforeFilter(). I commented the $components array.
> > There's nothing in the model (nor AppModel) that would screw with the
> > data.
>
> > This was working earlier. Well, it was broken (it's early going) but I
> > could debugger::log($this->data) just fine before. I must have done
> > *something* to screw this up but, after staring at it for a couple of
> > hours now, I'm absolutely fresh out of ideas.
>
> > On Sun, Jan 11, 2009 at 11:40 PM, brian  wrote:
> >> I'm trying to debug a problem with one of my controllers where
> >> $this->data is (almost) empty (more on that in a sec) and so tossed a
> >> bunch of Debugger::log statements in the action. When I checked the
> >> debug.log I found that the entries are being repeated.
>
> >> The action starts out like this. I put several debugger statements in
> >> because I was trying to figure out what was happening to $this->data.
>
> >> public function add($media_type_slug = null)
> >> {
> >>        $this->set('user_id', $this->Session->read('User.id'));
>
> >>        debugger::log('controller -- first');
> >>        debugger::log($this->data);
> >>        ...
> >>        // more stuff, and several other Debugger::log() statements
>
> >> debug.log:
>
> >> 2009-01-11 23:17:17 Debug: "controller -- first"
> >> 2009-01-11 23:17:17 Debug: null
> >> 2009-01-11 23:17:19 Debug: "controller -- first"
> >> 2009-01-11 23:17:19 Debug: null
> >> 2009-01-11 23:17:21 Debug: "controller -- first"
> >> 2009-01-11 23:17:21 Debug: null
> >> 2009-01-11 23:17:50 Debug: "controller -- first"
> >> 2009-01-11 23:17:50 Debug: array(
> >>        "Record" => array(),
> >>        "Discipline" => array()
> >> )
> >> 2009-01-11 23:17:50 Debug: "controller -- second"
> >> 2009-01-11 23:17:50 Debug: array(
> >>        "Record" => array(),
> >>        "Discipline" => array()
> >> )
> >> 2009-01-11 23:17:50 Debug: "controller -- third"
> >> 2009-01-11 23:17:50 Debug: array(
> >>        "Record" => array(),
> >>        "Discipline" => array()
> >> )
>
> >> The first 3 occur the first time I hit the action. $this->data is
> >> properly empty. What's weird, though, is that Debugger places 3
> >> entries, each 2 seconds apart, in the log.
>
> >> Now, when I submit the form at 23:17:50, I don't see that first one
> >> repeated. So, what's up with that? It can't be that Cake is running
> >> through the method 3 times the first time, can it? Because the other
> >> Debugger stateents are all inside an if(empty($this->data)) block.
>
> >> Anyway, besides all of that, as you can see, when the form is
> >> submitted, I'm only seeing the names of the 2 models used in the form,
> >> but no data at all. Anyone have any ideas on that? I'm well and truly
> >> stumped!
>
> >> The form is nothing special and looks like:
>
> >> echo $form->create('Record', array('action' => 'add', 'type' => 'file'));
> >> echo $form->hidden('Record.user_id', array('value' => $user_id));

Re: bug in Debugger?

2009-01-11 Thread brian

more: I put this immediately inside add()

die(debug($this->data));
Debugger::dump($this->data);

This dumps the data--intact--onto the page. When I comment out the
die() line, I get:

array(
"Record" => array(),
"Discipline" => array()
)

I can't see how this possibly could be a PEBCAK situation, though I'd
be grateful just to figure this out.

How the heck can the data be disappearing like this?!

I realise this probably isn't a Debugger problem and I really should
open a new thread, but Debugger sure isn't helping, in any case. That,
and the repeated writes to the log make me wonder. But, all the same,
with no Debugger calls, the data still goes bye-bye.

HELP!

On Mon, Jan 12, 2009 at 1:35 AM, brian  wrote:
> More on this: I put this in the controller:
>
> function beforeFilter()
> {
>die(debug($this->data));
> }
>
> So, when I submitted the form, all the data was right where it should
> be. (Obviously, I commented it to get the form to display). So, its
> disappearing act comes somewhere between beforeFilter() and add().
> I've been trying to hunt down the precise order of operations but have
> come up empty-handed. I know that I saw it somewhere once (it'd be
> nice if this was included in the Cookbook's "A Typical CakePHP
> Request" page). Is there anything between beforeFilter() and the
> controller's action??
>
> Before doing this, btw, there was no beforeFilter(). I've commented
> AppController::beforeFilter(). I commented the $components array.
> There's nothing in the model (nor AppModel) that would screw with the
> data.
>
> This was working earlier. Well, it was broken (it's early going) but I
> could debugger::log($this->data) just fine before. I must have done
> *something* to screw this up but, after staring at it for a couple of
> hours now, I'm absolutely fresh out of ideas.
>
> On Sun, Jan 11, 2009 at 11:40 PM, brian  wrote:
>> I'm trying to debug a problem with one of my controllers where
>> $this->data is (almost) empty (more on that in a sec) and so tossed a
>> bunch of Debugger::log statements in the action. When I checked the
>> debug.log I found that the entries are being repeated.
>>
>> The action starts out like this. I put several debugger statements in
>> because I was trying to figure out what was happening to $this->data.
>>
>> public function add($media_type_slug = null)
>> {
>>$this->set('user_id', $this->Session->read('User.id'));
>>
>>debugger::log('controller -- first');
>>debugger::log($this->data);
>>...
>>// more stuff, and several other Debugger::log() statements
>>
>> debug.log:
>>
>> 2009-01-11 23:17:17 Debug: "controller -- first"
>> 2009-01-11 23:17:17 Debug: null
>> 2009-01-11 23:17:19 Debug: "controller -- first"
>> 2009-01-11 23:17:19 Debug: null
>> 2009-01-11 23:17:21 Debug: "controller -- first"
>> 2009-01-11 23:17:21 Debug: null
>> 2009-01-11 23:17:50 Debug: "controller -- first"
>> 2009-01-11 23:17:50 Debug: array(
>>"Record" => array(),
>>"Discipline" => array()
>> )
>> 2009-01-11 23:17:50 Debug: "controller -- second"
>> 2009-01-11 23:17:50 Debug: array(
>>"Record" => array(),
>>"Discipline" => array()
>> )
>> 2009-01-11 23:17:50 Debug: "controller -- third"
>> 2009-01-11 23:17:50 Debug: array(
>>"Record" => array(),
>>"Discipline" => array()
>> )
>>
>>
>> The first 3 occur the first time I hit the action. $this->data is
>> properly empty. What's weird, though, is that Debugger places 3
>> entries, each 2 seconds apart, in the log.
>>
>> Now, when I submit the form at 23:17:50, I don't see that first one
>> repeated. So, what's up with that? It can't be that Cake is running
>> through the method 3 times the first time, can it? Because the other
>> Debugger stateents are all inside an if(empty($this->data)) block.
>>
>> Anyway, besides all of that, as you can see, when the form is
>> submitted, I'm only seeing the names of the 2 models used in the form,
>> but no data at all. Anyone have any ideas on that? I'm well and truly
>> stumped!
>>
>> The form is nothing special and looks like:
>>
>> echo $form->create('Record', array('action' => 'add', 'type' => 'file'));
>> echo $form->hidden('Record.user_id', array('value' => $user_id));
>> echo $form->hidden('Record.media_type_id', array('value' =>
>> $media_type['MediaType']['id']));
>> echo $form->hidden('Record.media_type_slug', array('value' =>
>> $media_type['MediaType']['slug']));
>> ...
>>
>> echo $form->end('send it');
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: bug in Debugger?

2009-01-11 Thread brian

More on this: I put this in the controller:

function beforeFilter()
{
die(debug($this->data));
}

So, when I submitted the form, all the data was right where it should
be. (Obviously, I commented it to get the form to display). So, its
disappearing act comes somewhere between beforeFilter() and add().
I've been trying to hunt down the precise order of operations but have
come up empty-handed. I know that I saw it somewhere once (it'd be
nice if this was included in the Cookbook's "A Typical CakePHP
Request" page). Is there anything between beforeFilter() and the
controller's action??

Before doing this, btw, there was no beforeFilter(). I've commented
AppController::beforeFilter(). I commented the $components array.
There's nothing in the model (nor AppModel) that would screw with the
data.

This was working earlier. Well, it was broken (it's early going) but I
could debugger::log($this->data) just fine before. I must have done
*something* to screw this up but, after staring at it for a couple of
hours now, I'm absolutely fresh out of ideas.

On Sun, Jan 11, 2009 at 11:40 PM, brian  wrote:
> I'm trying to debug a problem with one of my controllers where
> $this->data is (almost) empty (more on that in a sec) and so tossed a
> bunch of Debugger::log statements in the action. When I checked the
> debug.log I found that the entries are being repeated.
>
> The action starts out like this. I put several debugger statements in
> because I was trying to figure out what was happening to $this->data.
>
> public function add($media_type_slug = null)
> {
>$this->set('user_id', $this->Session->read('User.id'));
>
>debugger::log('controller -- first');
>debugger::log($this->data);
>...
>// more stuff, and several other Debugger::log() statements
>
> debug.log:
>
> 2009-01-11 23:17:17 Debug: "controller -- first"
> 2009-01-11 23:17:17 Debug: null
> 2009-01-11 23:17:19 Debug: "controller -- first"
> 2009-01-11 23:17:19 Debug: null
> 2009-01-11 23:17:21 Debug: "controller -- first"
> 2009-01-11 23:17:21 Debug: null
> 2009-01-11 23:17:50 Debug: "controller -- first"
> 2009-01-11 23:17:50 Debug: array(
>"Record" => array(),
>"Discipline" => array()
> )
> 2009-01-11 23:17:50 Debug: "controller -- second"
> 2009-01-11 23:17:50 Debug: array(
>"Record" => array(),
>"Discipline" => array()
> )
> 2009-01-11 23:17:50 Debug: "controller -- third"
> 2009-01-11 23:17:50 Debug: array(
>"Record" => array(),
>"Discipline" => array()
> )
>
>
> The first 3 occur the first time I hit the action. $this->data is
> properly empty. What's weird, though, is that Debugger places 3
> entries, each 2 seconds apart, in the log.
>
> Now, when I submit the form at 23:17:50, I don't see that first one
> repeated. So, what's up with that? It can't be that Cake is running
> through the method 3 times the first time, can it? Because the other
> Debugger stateents are all inside an if(empty($this->data)) block.
>
> Anyway, besides all of that, as you can see, when the form is
> submitted, I'm only seeing the names of the 2 models used in the form,
> but no data at all. Anyone have any ideas on that? I'm well and truly
> stumped!
>
> The form is nothing special and looks like:
>
> echo $form->create('Record', array('action' => 'add', 'type' => 'file'));
> echo $form->hidden('Record.user_id', array('value' => $user_id));
> echo $form->hidden('Record.media_type_id', array('value' =>
> $media_type['MediaType']['id']));
> echo $form->hidden('Record.media_type_slug', array('value' =>
> $media_type['MediaType']['slug']));
> ...
>
> echo $form->end('send it');
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug in text->truncate()?

2008-12-09 Thread Günther Theilen

I use the svn trunk so I changed the .htacces file and it works fine.

Thanks!

Regards
Guenther

grigri wrote:
> Check your core version. TextHelper was updated to use mb_* functions
> in #7842. I checked with your specific example and it works fine.
> 
> https://trac.cakephp.org/changeset/7842/branches/1.2.x.x/cake/libs/view/helpers/text.php
> 
> If you can't upgrade you can try turning on function overloading: add
> these lines to your webroot/.htaccess file:
> 
> php_value mbstring.internal_encoding UTF-8
> php_value default_charset UTF-8
> php_value mbstring.detect_order UTF-8
> php_value mbstring.func_overload 7
> 
> This will overload string functions (strlen, substr, ...) to use the
> mb_* versions transparently.
> 
> hth
> grigri
> 
> On Dec 9, 12:06 pm, Günther Theilen <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I have a problem with truncate() and German umlauts (äöü).
>> (The DB and the php code is in utf-8)
>>
>> $test = "xäx";
>> debug ($text->truncate($test, 9));
>>
>> I would expect it to return
>> xä...
>> but it returns
>> x?...
>>
>> Bug or feature?
>>
>> Regards
>> Guenther
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug in text->truncate()?

2008-12-09 Thread Henrique Machado
What  returns?

2008/12/9 Günther Theilen <[EMAIL PROTECTED]>

>
> Hi,
>
> I have a problem with truncate() and German umlauts (äöü).
> (The DB and the php code is in utf-8)
>
> $test = "xäx";
> debug ($text->truncate($test, 9));
>
> I would expect it to return
> xä...
> but it returns
> x?...
>
> Bug or feature?
>
> Regards
> Guenther
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug in text->truncate()?

2008-12-09 Thread grigri

Check your core version. TextHelper was updated to use mb_* functions
in #7842. I checked with your specific example and it works fine.

https://trac.cakephp.org/changeset/7842/branches/1.2.x.x/cake/libs/view/helpers/text.php

If you can't upgrade you can try turning on function overloading: add
these lines to your webroot/.htaccess file:

php_value mbstring.internal_encoding UTF-8
php_value default_charset UTF-8
php_value mbstring.detect_order UTF-8
php_value mbstring.func_overload 7

This will overload string functions (strlen, substr, ...) to use the
mb_* versions transparently.

hth
grigri

On Dec 9, 12:06 pm, Günther Theilen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a problem with truncate() and German umlauts (äöü).
> (The DB and the php code is in utf-8)
>
> $test = "xäx";
> debug ($text->truncate($test, 9));
>
> I would expect it to return
> xä...
> but it returns
> x?...
>
> Bug or feature?
>
> Regards
> Guenther
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug in Containable?

2008-12-06 Thread brian

I forgot to mention that this problem exists with the latest nightly
(1.2.x.x_06.12.2008) as well.

On Sat, Dec 6, 2008 at 11:24 PM, brian <[EMAIL PROTECTED]> wrote:
> cake_1.2.0.7692_RC3
>
> I think I've found a bug where 2 different elements are called on a
> page, each for different controllers, and each method uses a contain
> block in find conditions. I've just spent several hours trying to
> figure out why Containable was refusing to fetch data from a
> particular model, only to realise that it does work once I remove a
> previous element() call from the page.
>
> I have gone through Trac to see if this is already been reported.
> Please excuse me if I missed it, as my head is pretty well spinning
> from trying to figure this out (and going through Containable line by
> line tonight). My guess is this is an unbinding issue, and there are
> some reports of that, but I'm really not sure if what I'm looking at
> on Trac is the same thing.
>
> Here's the lowdown:
>
> class AppModel extends Model {
>var $actsAs = array('Containable');
> ...
>
> class User extends AppModel
> {
>var $name = 'User';
>var $hasOne = array(
>'Admin',
>'Professional',
>'Organisation'
>);
>var $hasMany = array(
>'Publication',
>'Post'
>);
> ...
>
> class Post extends AppModel
> {
>var $name = 'Post';
>var $belongsTo = array('User', 'PostCategory');
> ...
>
> class PostsController extends AppController {
>
>/* this method is called from an element
> */
>function front_page()
>{
>$criteria = array(
>'conditions' => array(
>'OR' => array(
>'Post.embargo IS NULL',
>'Post.embargo < NOW()'
>)
>),
>'limit' => 5,
>'fields' => array(
>'Post.id',
>'Post.created',
>'Post.user_id',
>'Post.comments_enabled',
>'Post.title',
>'Post.intro',
>'Post.body'
>),
>'contain' => array(
>'PostCategory' => array(
>'fields' => array('name')
>),
>'User' => array(
>'Admin' => array(   // <-- this is the 
> model that doesn't get
> included in the query
>'fields' => array(
>'first_name', 
> 'last_name'
>)
>)
>)
>)
>);
>return $this->Post->find('all', $criteria);
>}
>
>
> Now, in home.ctp, I have 2 element() calls. One is for the method
> above, and the other is to PublicationsController. In that method, the
> $criteria is almost the same, except I'm getting
> Professional.first_name, etc. instead of Admin (well, and it's
> selecting publications, obviously).
>
> Whichever one comes first on the page works fine. The other one will
> get all the data for User, but not for Admin or Professional. If I
> switch the second one to come first, it works and the other one fails.
> So, I know my associations are all good.
>
> As I said, I tried to figure out if this was already on Trac but
> nothing jumped out at me. I'm just bloody thankful I removed thefirst
> element temporarily of I'd never have figured out what's been driving
> me freaking crazy for ... crap! 4 hours now.
>
>
> For anyone who understands Containable better than me, does this seem
> like something new?
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-25 Thread Mark (Germany)

only thing i can say, is that villas and Dardo Sordi Bogado were right
there was no documentation on that, but now i know that it is better
to avoid such naming conflicts

anyway, if i ever publish a "cake Look-Out-list", this will definitly
be on it


i still do not know what xavier wanted to tell me :)





On 10 Nov., 14:27, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> I am still over looking the problem and then i will prepare a
> statement and tell you my point.
>
> On 11/10/2008, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > @xavier:
> > what exactly is your point? :)
>
> > On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]>
> > wrote:
> >> well, i sure could have renamed it if i had known that it is a problem
> >> a) to name a field like the model
> >> b) to name it like a reserved word
>
> >> thx so far
>
> >> On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>
> >> > What they said lol. If you find your self bugging with the date dont
> >> > use it without debugging.
>
> >> > On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>
> >> > > Avoid naming a field the same as the model and this will not happen ;)
>
> >> > > On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
> >> > > <[EMAIL PROTECTED]> wrote:
>
> >> > >> As the pr() output shows, the processed form data on POST
> >> > >> returns a devided array with the normal "Date" and a second "date"
> >> > >> resulting in 2 warnings (Undefined variable: month/year) + the form
> >> > >> process recognized as invalide.
>
> >> > >> Array
> >> > >> (
> >> > >>    [Date] => Array
> >> > >>        (
> >> > >>            [user_id] => 1
> >> > >>            [date_type_id] => 1
> >> > >>            [date] => Array
> >> > >>                (
> >> > >>                    [day] => 09
> >> > >>                )
>
> >> > >>            [details] =>
> >> > >>        )
>
> >> > >>    [date] => Array
> >> > >>        (
> >> > >>            [date] => Array
> >> > >>                (
> >> > >>                    [month] => 11
> >> > >>                    [year] => 2008
> >> > >>                )
>
> >> > >>        )
>
> >> > >> )
>
> >> > >> The Form was baked by the console
>
> >> > >> create('Date');?>
> >> > >>        
> >> > >>                
> >> > >>         >> > >>                echo $form->input('user_id');
> >> > >>                echo $form->input('date_type_id');
> >> > >>                echo $form->input('date');
> >> > >>                echo $form->input('details');
> >> > >>        ?>
> >> > >>        
> >> > >> end('Submit');?>
>
> >> > >> I cant find the problem - the database field is of the normal "date"
> >> > >> type
>
> >> > >> Wow..
> >> > >> After changing it to the following, it worked...
>
> >> > >>         >> > >>                echo $form->input('Date.user_id');
> >> > >>                echo $form->input('Date.date_type_id');
> >> > >>                echo $form->input('Date.date');
> >> > >>                echo $form->input('Date.details');
> >> > >>        ?>
>
> >> > >> So why is this neccessary if there is only that one model Date?
>
> >> > --
> >> > Xavier A. Mathews
> >> > Student/Developer/Web-Master
> >> > GG Client Based Tech Support Specialist
> >> > Hazel Crest Illinois
> >> > [EMAIL PROTECTED]@[EMAIL PROTECTED]
> >> > "Fear of a name, only increases fear of the thing itself."
>
> --
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]@[EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-10 Thread Xavier Mathews

I am still over looking the problem and then i will prepare a
statement and tell you my point.

On 11/10/2008, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
> @xavier:
> what exactly is your point? :)
>
>
> On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]>
> wrote:
>> well, i sure could have renamed it if i had known that it is a problem
>> a) to name a field like the model
>> b) to name it like a reserved word
>>
>> thx so far
>>
>> On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>>
>> > What they said lol. If you find your self bugging with the date dont
>> > use it without debugging.
>>
>> > On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>>
>> > > Avoid naming a field the same as the model and this will not happen ;)
>>
>> > > On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
>> > > <[EMAIL PROTECTED]> wrote:
>>
>> > >> As the pr() output shows, the processed form data on POST
>> > >> returns a devided array with the normal "Date" and a second "date"
>> > >> resulting in 2 warnings (Undefined variable: month/year) + the form
>> > >> process recognized as invalide.
>>
>> > >> Array
>> > >> (
>> > >>[Date] => Array
>> > >>(
>> > >>[user_id] => 1
>> > >>[date_type_id] => 1
>> > >>[date] => Array
>> > >>(
>> > >>[day] => 09
>> > >>)
>>
>> > >>[details] =>
>> > >>)
>>
>> > >>[date] => Array
>> > >>(
>> > >>[date] => Array
>> > >>(
>> > >>[month] => 11
>> > >>[year] => 2008
>> > >>)
>>
>> > >>)
>>
>> > >> )
>>
>> > >> The Form was baked by the console
>>
>> > >> create('Date');?>
>> > >>
>> > >>
>> > >>> > >>echo $form->input('user_id');
>> > >>echo $form->input('date_type_id');
>> > >>echo $form->input('date');
>> > >>echo $form->input('details');
>> > >>?>
>> > >>
>> > >> end('Submit');?>
>>
>> > >> I cant find the problem - the database field is of the normal "date"
>> > >> type
>>
>> > >> Wow..
>> > >> After changing it to the following, it worked...
>>
>> > >>> > >>echo $form->input('Date.user_id');
>> > >>echo $form->input('Date.date_type_id');
>> > >>echo $form->input('Date.date');
>> > >>echo $form->input('Date.details');
>> > >>?>
>>
>> > >> So why is this neccessary if there is only that one model Date?
>>
>> > --
>> > Xavier A. Mathews
>> > Student/Developer/Web-Master
>> > GG Client Based Tech Support Specialist
>> > Hazel Crest Illinois
>> > [EMAIL PROTECTED]@[EMAIL PROTECTED]
>> > "Fear of a name, only increases fear of the thing itself."
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]@[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-10 Thread Mark (Germany)

@xavier:
what exactly is your point? :)


On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]>
wrote:
> well, i sure could have renamed it if i had known that it is a problem
> a) to name a field like the model
> b) to name it like a reserved word
>
> thx so far
>
> On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
>
> > What they said lol. If you find your self bugging with the date dont
> > use it without debugging.
>
> > On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>
> > > Avoid naming a field the same as the model and this will not happen ;)
>
> > > On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
> > > <[EMAIL PROTECTED]> wrote:
>
> > >> As the pr() output shows, the processed form data on POST
> > >> returns a devided array with the normal "Date" and a second "date"
> > >> resulting in 2 warnings (Undefined variable: month/year) + the form
> > >> process recognized as invalide.
>
> > >> Array
> > >> (
> > >>    [Date] => Array
> > >>        (
> > >>            [user_id] => 1
> > >>            [date_type_id] => 1
> > >>            [date] => Array
> > >>                (
> > >>                    [day] => 09
> > >>                )
>
> > >>            [details] =>
> > >>        )
>
> > >>    [date] => Array
> > >>        (
> > >>            [date] => Array
> > >>                (
> > >>                    [month] => 11
> > >>                    [year] => 2008
> > >>                )
>
> > >>        )
>
> > >> )
>
> > >> The Form was baked by the console
>
> > >> create('Date');?>
> > >>        
> > >>                
> > >>         > >>                echo $form->input('user_id');
> > >>                echo $form->input('date_type_id');
> > >>                echo $form->input('date');
> > >>                echo $form->input('details');
> > >>        ?>
> > >>        
> > >> end('Submit');?>
>
> > >> I cant find the problem - the database field is of the normal "date"
> > >> type
>
> > >> Wow..
> > >> After changing it to the following, it worked...
>
> > >>         > >>                echo $form->input('Date.user_id');
> > >>                echo $form->input('Date.date_type_id');
> > >>                echo $form->input('Date.date');
> > >>                echo $form->input('Date.details');
> > >>        ?>
>
> > >> So why is this neccessary if there is only that one model Date?
>
> > --
> > Xavier A. Mathews
> > Student/Developer/Web-Master
> > GG Client Based Tech Support Specialist
> > Hazel Crest Illinois
> > [EMAIL PROTECTED]@[EMAIL PROTECTED]
> > "Fear of a name, only increases fear of the thing itself."
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-10 Thread Mark (Germany)

well, i sure could have renamed it if i had known that it is a problem
a) to name a field like the model
b) to name it like a reserved word

thx so far


On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> What they said lol. If you find your self bugging with the date dont
> use it without debugging.
>
> On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Avoid naming a field the same as the model and this will not happen ;)
>
> > On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
> > <[EMAIL PROTECTED]> wrote:
>
> >> As the pr() output shows, the processed form data on POST
> >> returns a devided array with the normal "Date" and a second "date"
> >> resulting in 2 warnings (Undefined variable: month/year) + the form
> >> process recognized as invalide.
>
> >> Array
> >> (
> >>    [Date] => Array
> >>        (
> >>            [user_id] => 1
> >>            [date_type_id] => 1
> >>            [date] => Array
> >>                (
> >>                    [day] => 09
> >>                )
>
> >>            [details] =>
> >>        )
>
> >>    [date] => Array
> >>        (
> >>            [date] => Array
> >>                (
> >>                    [month] => 11
> >>                    [year] => 2008
> >>                )
>
> >>        )
>
> >> )
>
> >> The Form was baked by the console
>
> >> create('Date');?>
> >>        
> >>                
> >>         >>                echo $form->input('user_id');
> >>                echo $form->input('date_type_id');
> >>                echo $form->input('date');
> >>                echo $form->input('details');
> >>        ?>
> >>        
> >> end('Submit');?>
>
> >> I cant find the problem - the database field is of the normal "date"
> >> type
>
> >> Wow..
> >> After changing it to the following, it worked...
>
> >>         >>                echo $form->input('Date.user_id');
> >>                echo $form->input('Date.date_type_id');
> >>                echo $form->input('Date.date');
> >>                echo $form->input('Date.details');
> >>        ?>
>
> >> So why is this neccessary if there is only that one model Date?
>
> --
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]@[EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-09 Thread Xavier Mathews

What they said lol. If you find your self bugging with the date dont
use it without debugging.

On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>
> Avoid naming a field the same as the model and this will not happen ;)
>
> On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
> <[EMAIL PROTECTED]> wrote:
>>
>> As the pr() output shows, the processed form data on POST
>> returns a devided array with the normal "Date" and a second "date"
>> resulting in 2 warnings (Undefined variable: month/year) + the form
>> process recognized as invalide.
>>
>> Array
>> (
>>[Date] => Array
>>(
>>[user_id] => 1
>>[date_type_id] => 1
>>[date] => Array
>>(
>>[day] => 09
>>)
>>
>>[details] =>
>>)
>>
>>[date] => Array
>>(
>>[date] => Array
>>(
>>[month] => 11
>>[year] => 2008
>>)
>>
>>)
>>
>> )
>>
>> The Form was baked by the console
>>
>> create('Date');?>
>>
>>
>>>echo $form->input('user_id');
>>echo $form->input('date_type_id');
>>echo $form->input('date');
>>echo $form->input('details');
>>?>
>>
>> end('Submit');?>
>>
>> I cant find the problem - the database field is of the normal "date"
>> type
>>
>>
>> Wow..
>> After changing it to the following, it worked...
>>
>>>echo $form->input('Date.user_id');
>>echo $form->input('Date.date_type_id');
>>echo $form->input('Date.date');
>>echo $form->input('Date.details');
>>?>
>>
>> So why is this neccessary if there is only that one model Date?
>> >
>>
>
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]@[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-09 Thread Dardo Sordi Bogado

Avoid naming a field the same as the model and this will not happen ;)

On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
<[EMAIL PROTECTED]> wrote:
>
> As the pr() output shows, the processed form data on POST
> returns a devided array with the normal "Date" and a second "date"
> resulting in 2 warnings (Undefined variable: month/year) + the form
> process recognized as invalide.
>
> Array
> (
>[Date] => Array
>(
>[user_id] => 1
>[date_type_id] => 1
>[date] => Array
>(
>[day] => 09
>)
>
>[details] =>
>)
>
>[date] => Array
>(
>[date] => Array
>(
>[month] => 11
>[year] => 2008
>)
>
>)
>
> )
>
> The Form was baked by the console
>
> create('Date');?>
>
>
>echo $form->input('user_id');
>echo $form->input('date_type_id');
>echo $form->input('date');
>echo $form->input('details');
>?>
>
> end('Submit');?>
>
> I cant find the problem - the database field is of the normal "date"
> type
>
>
> Wow..
> After changing it to the following, it worked...
>
>echo $form->input('Date.user_id');
>echo $form->input('Date.date_type_id');
>echo $form->input('Date.date');
>echo $form->input('Date.details');
>?>
>
> So why is this neccessary if there is only that one model Date?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? or whats the matter with date fields?

2008-11-09 Thread villas

Having had a tough time in the past with this kind of problem,  I
would instinctively try to avoid using typical reserved words such as
'date'. These kinds of issues are notoriously difficult to resolve,
and tend to crop up again later.  I appreciate this is not an answer
to the question,  but couldn't you simply side-step the problem by
renaming the field?

On Nov 9, 10:03 pm, "Mark (Germany)" <[EMAIL PROTECTED]>
wrote:
> As the pr() output shows, the processed form data on POST
> returns a devided array with the normal "Date" and a second "date"
> resulting in 2 warnings (Undefined variable: month/year) + the form
> process recognized as invalide.
>
> Array
> (
>     [Date] => Array
>         (
>             [user_id] => 1
>             [date_type_id] => 1
>             [date] => Array
>                 (
>                     [day] => 09
>                 )
>
>             [details] =>
>         )
>
>     [date] => Array
>         (
>             [date] => Array
>                 (
>                     [month] => 11
>                     [year] => 2008
>                 )
>
>         )
>
> )
>
> The Form was baked by the console
>
> create('Date');?>
>         
>                 
>                          echo $form->input('user_id');
>                 echo $form->input('date_type_id');
>                 echo $form->input('date');
>                 echo $form->input('details');
>         ?>
>         
> end('Submit');?>
>
> I cant find the problem - the database field is of the normal "date"
> type
>
> Wow..
> After changing it to the following, it worked...
>
>                          echo $form->input('Date.user_id');
>                 echo $form->input('Date.date_type_id');
>                 echo $form->input('Date.date');
>                 echo $form->input('Date.details');
>         ?>
>
> So why is this neccessary if there is only that one model Date?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread [EMAIL PROTECTED]

It apears to be from 7389 "Removed almost all am() calls from core."
https://trac.cakephp.org/changeset?new=branches%2F1.2.x.x%2Fcake%2Flibs%2Fmodel%2Fmodel.php%407389&old=branches%2F1.2.x.x%2Fcake%2Flibs%2Fmodel%2Fmodel.php%407384

am() puts any string into a new array. When am() was swapped for
array_merge() that conversion was lost and Model::_deleteDependent()
started outputting type-mismatch errors. I spent a few minutes
rewriting all conditions I have defined in associations to be arrays.
That seems to cure it.

I expected this to be the new desired behaviour (even though the
function could handle bad parameters a little better) so I submitted a
few changes to The Book where association conditions are specified as
strings. If this indeed is not the new desired behaviour, then my
changes should of-course be ignored.


/Martin


On Oct 14, 5:31 pm, gwoo <[EMAIL PROTECTED]> wrote:
> Can you find a changeset that modified the behavior?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread Joel Perras

$ svn blame 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/libs/model/model.php

-J.

On Oct 14, 12:29 pm, Mathew <[EMAIL PROTECTED]> wrote:
> Is it possible to see all the changesets for RC3 on a specific file?
>
> For example; How can I browse the history of changes to the model.php
> file?
>
> I've been looking around the Cake website, I can see the SVN urls, the
> source code browser, but I'm looking for something like WebSVN.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread Mathew

Is it possible to see all the changesets for RC3 on a specific file?

For example; How can I browse the history of changes to the model.php
file?

I've been looking around the Cake website, I can see the SVN urls, the
source code browser, but I'm looking for something like WebSVN.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread gwoo

Can you find a changeset that modified the behavior?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: [BUG] - AD7six Upload Behaviour

2008-09-06 Thread José Pablo Orozco Marín

If I upload a file named:
Bloqueo con espacios   .jpg

It is uploaded to uploads folder with filename bloqueo_con_espacios.jpg ,
but is not converted or resized in images path.



If I upload a file named:
Bloqueoconespacios.jpg

It is uploaded to uploads folder with filename bloqueoconespacios.jpg ,
and it converted or resized in images path.


Thank you.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with invalidating HABTM field

2008-09-06 Thread MarcS

I'm having the same problem right now.
Does anyone have a solution to this?

On 12 Jul, 09:42, Dia <[EMAIL PROTECTED]> wrote:
> hi all,
>
> I use 1.2 RC2
> I have 2 models (model1 and model2) linked by HABTM
>
> if I write in model1 / beforeSave() : if (...) { $this->invalidate('Model2', 
> 'some text'); return false; }
>
> when the form is displayed, I juste see the first letter of the error
> message
>
> for me, the error seems to come from cake / libs / view / helper /
> tagIsInvalid :
> the function returns $errors[$model][$field]
> but in this case, $error = array(1) { ["Model2"] => string(9) "some
> text" }
>
> is it a bug or am I doing something wrong ?
>
> thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? title not defined when not using a layout

2008-07-02 Thread leo

Like I said, "I can see where this is coming from in the API". The
point is:

Controller::set($one,$two = null)

* Saves a variable to use inside a template.

Does not say except when it is called 'title'. If the $title variable
(or whatever it is we call it) is only to be visible inside a layout
and not a template, then it should have it's own setting method, e.g.
Controller::setPageTitle.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? title not defined when not using a layout

2008-07-02 Thread Renan Gonçalves
Please, take a look at:

http://api.cakephp.org/class_controller.html#8d64f371009811f1d5662a491ba5cf82-
when $this->set('title') will set $this->pageTitle and will not give
the
var to view.
Related tickets:
 - https://trac.cakephp.org/ticket/4817
 - https://trac.cakephp.org/ticket/4818

On Tue, Jul 1, 2008 at 12:32 PM, leo <[EMAIL PROTECTED]> wrote:

>
> Did you read what I wrote?
>
> On 1 Jul, 16:22, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> > Did you read the manual?
> > Anyway, take a look again, please:
> http://manual.cakephp.org/view/54/page-related-attributes-layout
> >
> > The $pageTitle controller attribute allows you to set the title of the
> >
> >
> >
> > > rendered page. In order for this to work properly, your layout needs to
> > > include the *$title_for_layout* variable, at least between  tags
> in
> > > the head of the HTML document.
> >
> > On Tue, Jul 1, 2008 at 8:27 AM, leo <[EMAIL PROTECTED]> wrote:
> >
> > >$this->pageTitle = "my title";
> > >$this->layout = 'pageDefault';
> >
> > > Works fine and $title_for_layout is set. The same if I miss out the
> > > second line as it then defaults to ... er.. default.
> >
> > > If, however, I say $this->layout = ''; then the page title is not
> > > visible in the view. Okay, I'll just do:
> > >$this->set('title', "my title");
> >
> > > and in the view:
> > >
> >
> > > Oh no! The variable $title is still unset. I can see where this is
> > > coming from in the API. If I use a varName other than $title, it works
> > > okay.
> >
> > > My feeling is that this is a bug, as if a viewVar is set in the
> > > controller, its accessibility in the view should not depend on its
> > > name.
> >
> > --
> > Renan Gonçalves - Software Engineer
> > Cell Phone: +55 11 8633 6018
> > MSN: [EMAIL PROTECTED]
> > São Paulo - SP/Brazil
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? title not defined when not using a layout

2008-07-01 Thread leo

Did you read what I wrote?

On 1 Jul, 16:22, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> Did you read the manual?
> Anyway, take a look again, 
> please:http://manual.cakephp.org/view/54/page-related-attributes-layout
>
> The $pageTitle controller attribute allows you to set the title of the
>
>
>
> > rendered page. In order for this to work properly, your layout needs to
> > include the *$title_for_layout* variable, at least between  tags in
> > the head of the HTML document.
>
> On Tue, Jul 1, 2008 at 8:27 AM, leo <[EMAIL PROTECTED]> wrote:
>
> >    $this->pageTitle = "my title";
> >    $this->layout = 'pageDefault';
>
> > Works fine and $title_for_layout is set. The same if I miss out the
> > second line as it then defaults to ... er.. default.
>
> > If, however, I say $this->layout = ''; then the page title is not
> > visible in the view. Okay, I'll just do:
> >    $this->set('title', "my title");
>
> > and in the view:
> >    
>
> > Oh no! The variable $title is still unset. I can see where this is
> > coming from in the API. If I use a varName other than $title, it works
> > okay.
>
> > My feeling is that this is a bug, as if a viewVar is set in the
> > controller, its accessibility in the view should not depend on its
> > name.
>
> --
> Renan Gonçalves - Software Engineer
> Cell Phone: +55 11 8633 6018
> MSN: [EMAIL PROTECTED]
> São Paulo - SP/Brazil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? title not defined when not using a layout

2008-07-01 Thread Renan Gonçalves
Did you read the manual?
Anyway, take a look again, please:
http://manual.cakephp.org/view/54/page-related-attributes-layout

The $pageTitle controller attribute allows you to set the title of the
> rendered page. In order for this to work properly, your layout needs to
> include the *$title_for_layout* variable, at least between  tags in
> the head of the HTML document.
>

On Tue, Jul 1, 2008 at 8:27 AM, leo <[EMAIL PROTECTED]> wrote:

>
>$this->pageTitle = "my title";
>$this->layout = 'pageDefault';
>
> Works fine and $title_for_layout is set. The same if I miss out the
> second line as it then defaults to ... er.. default.
>
> If, however, I say $this->layout = ''; then the page title is not
> visible in the view. Okay, I'll just do:
>$this->set('title', "my title");
>
> and in the view:
>
>
> Oh no! The variable $title is still unset. I can see where this is
> coming from in the API. If I use a varName other than $title, it works
> okay.
>
> My feeling is that this is a bug, as if a viewVar is set in the
> controller, its accessibility in the view should not depend on its
> name.
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug? title not defined when not using a layout

2008-07-01 Thread Renan Gonçalves
Did you read the manual?
Anyway, take a look again, please:
http://manual.cakephp.org/view/54/page-related-attributes-layout

The $pageTitle controller attribute allows you to set the title of the
> rendered page. In order for this to work properly, your layout needs to
> include the *$title_for_layout* variable, at least between  tags in
> the head of the HTML document.
>

On Tue, Jul 1, 2008 at 8:27 AM, leo <[EMAIL PROTECTED]> wrote:

>
>$this->pageTitle = "my title";
>$this->layout = 'pageDefault';
>
> Works fine and $title_for_layout is set. The same if I miss out the
> second line as it then defaults to ... er.. default.
>
> If, however, I say $this->layout = ''; then the page title is not
> visible in the view. Okay, I'll just do:
>$this->set('title', "my title");
>
> and in the view:
>
>
> Oh no! The variable $title is still unset. I can see where this is
> coming from in the API. If I use a varName other than $title, it works
> okay.
>
> My feeling is that this is a bug, as if a viewVar is set in the
> controller, its accessibility in the view should not depend on its
> name.
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with findAllThreaded in cake1.2 rc2 build 7296?

2008-06-30 Thread ray

Will do. Thanks Jonathan.

On Jun 30, 7:21 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
> Post it to trac. If at all possible, including a test case and/or
> patch would be helpeful as well.
>
> On Mon, Jun 30, 2008 at 10:12 PM, ray <[EMAIL PROTECTED]> wrote:
>
> > Hi there... I tried the irc room but didn't get a response.
>
> > I believe there's a new bug that was introduced with the latest
> > version of cake1.2rc2 (build 7296)
>
> > Previously findAllThreaded would work for tables that didn't have a
> > primary key of 'id' but as of this build looks like it was refactored
> > and hard coded to look for id only.
>
> > Changing line 1997 to be:
>
> > $id = $result[$this->alias][$this->primaryKey];
>
> > Fixes the problem.
>
> > As I mentioned in irc this is the first time I'm coming across a bug
> > that hasn't been encountered below so I'm trying to follow protocol.
> > I'm not sure if somebody can just fix this or if I should log a bug in
> > trac?
>
> > Thanks all. And keep up the great work on Cake.
>
> > - Ray
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with findAllThreaded in cake1.2 rc2 build 7296?

2008-06-30 Thread Jonathan Snook

Post it to trac. If at all possible, including a test case and/or
patch would be helpeful as well.

On Mon, Jun 30, 2008 at 10:12 PM, ray <[EMAIL PROTECTED]> wrote:
>
> Hi there... I tried the irc room but didn't get a response.
>
> I believe there's a new bug that was introduced with the latest
> version of cake1.2rc2 (build 7296)
>
> Previously findAllThreaded would work for tables that didn't have a
> primary key of 'id' but as of this build looks like it was refactored
> and hard coded to look for id only.
>
> Changing line 1997 to be:
>
> $id = $result[$this->alias][$this->primaryKey];
>
> Fixes the problem.
>
> As I mentioned in irc this is the first time I'm coming across a bug
> that hasn't been encountered below so I'm trying to follow protocol.
> I'm not sure if somebody can just fix this or if I should log a bug in
> trac?
>
> Thanks all. And keep up the great work on Cake.
>
> - Ray
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-07 Thread David Christopher Zentgraf

Since I'm manually specifying the table name I can call it whatever I  
want actually.
No, the problem turned out to be in one of my validation functions,  
the checkUnique() function I just took straight from the manual.
For some reason it only came up as a problem in the context of HABTM  
saves.

Chrs,
Dav

On 8 May 2008, at 01:56, NOSLOW wrote:

>
> I see one problem in that you're not following the Cake conventions
> when naming your HABTM join table. The convention is to join the table
> names in alphabetical order (keeping both table names plural):
>
> 'joinTable' => 'user_friends',
>
> should be
>
> 'joinTable' => 'friends_users',
>
> Fix that and let us know if that helps out.
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-07 Thread NOSLOW

I see one problem in that you're not following the Cake conventions
when naming your HABTM join table. The convention is to join the table
names in alphabetical order (keeping both table names plural):

'joinTable' => 'user_friends',

should be

'joinTable' => 'friends_users',

Fix that and let us know if that helps out.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread David Christopher Zentgraf

That just makes it throw another error:
SQL Error: 1054: Unknown column 'UserFriend.User.user_id' in 'on clause'

And it's not the HABTM relationship that's causing the problem.
I don't know why, but before saving a HABTM relationship Cake seems to  
do a lot of SELECTs for every related model, to make sure it's got the  
right users‽

It's tripping over the hasMany relationship between Users and  
Accounts, since both have a column with the same name.


On 7 May 2008, at 15:39, Grant Cox (Gmail) wrote:

> Change your HABTM to:
>
>   var $hasAndBelongsToMany = array(
>   'Group' => array(
>   'className'=> 'Group',
>   'joinTable'=> 'groups_users',
>   'foreignKey'=> 'user_id',
>   'associationForeignKey' => 'group_id',
>   'unique'=> true
>   ),
>   'Friend' => array(
>   'className'=> 'User',
>   'joinTable'=> 'user_friends',
>   'foreignKey'=> 'User.user_id',
>   'associationForeignKey' => 'Friend.friend_id',
>   'unique'=> true
>   )
>   );
>
> So you are specifying that in the join of the two tables, 'user_id'  
> is the left and 'friend_id' is the right.  This should avoid any  
> confusion.
>
> Grant
>
>
> David Christopher Zentgraf wrote:
>> Not quite sure what you're getting at, but please have a look:
>>
>>
>> class User extends AppModel {
>>
>>var $name = 'User';
>>
>>var $belongsTo = array(
>>'DefaultAccount' => array(
>>'className'=> 'Account',
>>'foreignKey'=> 'default_account_id'
>>)
>>);
>>
>>var $hasMany = array(
>>'Account' => array(
>>'className'=> 'Account',
>>'foreignKey'=> 'user_id',
>>'dependent'=> true
>>)
>>);
>>
>>var $hasAndBelongsToMany = array(
>>'Group' => array(
>>'className'=> 'Group',
>>'joinTable'=> 'groups_users',
>>'foreignKey'=> 'user_id',
>>'associationForeignKey' => 'group_id',
>>'unique'=> true
>>),
>>'Friend' => array(
>>'className'=> 'User',
>>'joinTable'=> 'user_friends',
>>'foreignKey'=> 'user_id',
>>'associationForeignKey' => 'friend_id',
>>'unique'=> true
>>)
>>);
>> }
>>
>> On 7 May 2008, at 15:22, Grant Cox wrote:
>>
>>>
>>> Can you post your $hasAndBelongsToMany variable definition?  I think
>>> you'll be able to fix your issue by just using the model alias
>>> prefixes in the 'foreignKey' and/or 'associationForeignKey' values.
>>>
>>>
>>> On May 7, 2:25 pm, David Christopher Zentgraf <[EMAIL PROTECTED]>
>>> wrote:
 Hi,

 I'm stumbling across bug number 4194.https://trac.cakephp.org/ticket/4194

 I have a User model, which has a `name` field.
 This User hasMany Accounts, which also have a `name` field.
 The User also hasAndBelongsToMany other Users as a friend  
 relationship.

 User (`name`, ...)
 |
 |- hasMany
 |  |- Accounts (`name`, ...)
 |
 |- hasAndBelongsToMany
   |- User

 When I try to save such a User-User HABTM relationship, Cake is  
 doing
 all sorts of lookups, apparently for every linked model.
 What it fails at is this query:

 SELECT COUNT(*) AS `count` FROM `users` AS `User`
 LEFT JOIN `accounts` AS `DefaultAccount`
  ON (`User`.`default_account_id` = `DefaultAccount`.`id`)
 WHERE ((`name` = '')) AND `User`.`id` != 1

 1052: Column 'name' in where clause is ambiguous

 The WHERE clause would need to be extended to query for  
 `User`.`name`
 instead of just `name`, since both tables have a column called  
 `name`.
 I'm not quite sure why Cake is doing all these queries in the first
 place, guess it's just being extra paranoid.

 Anyway, the above mentioned bug seems to be very related, but nate
 insists on a test case.
 I have no idea how to write test cases for something like this, so
 could a kind soul jump in?

 Chrs,
 Dav
>>> >>>
>>
>>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread David Christopher Zentgraf

Not quite sure what you're getting at, but please have a look:


class User extends AppModel {

var $name = 'User';

var $belongsTo = array(
'DefaultAccount' => array(
'className' => 'Account',
'foreignKey'=> 'default_account_id'
)
);

var $hasMany = array(
'Account' => array(
'className' => 'Account',
'foreignKey'=> 'user_id',
'dependent' => true
)
);

var $hasAndBelongsToMany = array(
'Group' => array(
'className' => 'Group',
'joinTable' => 'groups_users',
'foreignKey'=> 'user_id',
'associationForeignKey' => 'group_id',
'unique'=> true
),
'Friend' => array(
'className' => 'User',
'joinTable' => 'user_friends',
'foreignKey'=> 'user_id',
'associationForeignKey' => 'friend_id',
'unique'=> true
)
);
}

On 7 May 2008, at 15:22, Grant Cox wrote:

>
> Can you post your $hasAndBelongsToMany variable definition?  I think
> you'll be able to fix your issue by just using the model alias
> prefixes in the 'foreignKey' and/or 'associationForeignKey' values.
>
>
> On May 7, 2:25 pm, David Christopher Zentgraf <[EMAIL PROTECTED]>
> wrote:
>> Hi,
>>
>> I'm stumbling across bug number 4194.https://trac.cakephp.org/ticket/4194
>>
>> I have a User model, which has a `name` field.
>> This User hasMany Accounts, which also have a `name` field.
>> The User also hasAndBelongsToMany other Users as a friend  
>> relationship.
>>
>> User (`name`, ...)
>> |
>> |- hasMany
>> |  |- Accounts (`name`, ...)
>> |
>> |- hasAndBelongsToMany
>>|- User
>>
>> When I try to save such a User-User HABTM relationship, Cake is doing
>> all sorts of lookups, apparently for every linked model.
>> What it fails at is this query:
>>
>> SELECT COUNT(*) AS `count` FROM `users` AS `User`
>> LEFT JOIN `accounts` AS `DefaultAccount`
>>   ON (`User`.`default_account_id` = `DefaultAccount`.`id`)
>> WHERE ((`name` = '')) AND `User`.`id` != 1
>>
>> 1052: Column 'name' in where clause is ambiguous
>>
>> The WHERE clause would need to be extended to query for `User`.`name`
>> instead of just `name`, since both tables have a column called  
>> `name`.
>> I'm not quite sure why Cake is doing all these queries in the first
>> place, guess it's just being extra paranoid.
>>
>> Anyway, the above mentioned bug seems to be very related, but nate
>> insists on a test case.
>> I have no idea how to write test cases for something like this, so
>> could a kind soul jump in?
>>
>> Chrs,
>> Dav
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug: Saving HABTM relationship, "Column in where clause is ambiguous"

2008-05-06 Thread Grant Cox

Can you post your $hasAndBelongsToMany variable definition?  I think
you'll be able to fix your issue by just using the model alias
prefixes in the 'foreignKey' and/or 'associationForeignKey' values.


On May 7, 2:25 pm, David Christopher Zentgraf <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I'm stumbling across bug number 4194.https://trac.cakephp.org/ticket/4194
>
> I have a User model, which has a `name` field.
> This User hasMany Accounts, which also have a `name` field.
> The User also hasAndBelongsToMany other Users as a friend relationship.
>
> User (`name`, ...)
> |
> |- hasMany
> |  |- Accounts (`name`, ...)
> |
> |- hasAndBelongsToMany
> |- User
>
> When I try to save such a User-User HABTM relationship, Cake is doing
> all sorts of lookups, apparently for every linked model.
> What it fails at is this query:
>
> SELECT COUNT(*) AS `count` FROM `users` AS `User`
> LEFT JOIN `accounts` AS `DefaultAccount`
>ON (`User`.`default_account_id` = `DefaultAccount`.`id`)
> WHERE ((`name` = '')) AND `User`.`id` != 1
>
> 1052: Column 'name' in where clause is ambiguous
>
> The WHERE clause would need to be extended to query for `User`.`name`
> instead of just `name`, since both tables have a column called `name`.
> I'm not quite sure why Cake is doing all these queries in the first
> place, guess it's just being extra paranoid.
>
> Anyway, the above mentioned bug seems to be very related, but nate
> insists on a test case.
> I have no idea how to write test cases for something like this, so
> could a kind soul jump in?
>
> Chrs,
> Dav
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug with findAllThreaded

2008-04-18 Thread Renan Gonçalves
Ok... I got it!

I'll make a test case for this, thanks!


on Fri, Apr 18, 2008 at 2:18 AM, Sourabh Sharma <[EMAIL PROTECTED]>
> wrote:
>
> Hello,
>
> But I use that findAllThreaded its works fine for me. But we have to
> only take care about parent id  relationship. I followed the
> instruction from manual. Or may be there is difference of versions. I
> am using betaversion of cakephp.


What kind of care? Could you explain?
The only way to sort is putting "ORDER BY parent_id ASC"!


[]'s

On Fri, Apr 18, 2008 at 3:30 AM, Adam Royle <[EMAIL PROTECTED]> wrote:

>
> It was closed because there was no reproducable test case attached to
> the ticket.
>
> On Apr 18, 12:59 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I was trying the method findAllThreaded and I have found a bug!
> > I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too.
> > There is a table called sections (model Section) with id, parent_id,
> > created, modified and name.
> >
> > When I try to sort this data with $sections =
> > $this->Section->findAllThreaded(null, null, 'Section.name ASC'); the
> result
> > is only one Section, but there are 5.
> > The only way to get all data is sorting by modified field.
> >
> > The problem is in:
> > /**
> >  * Private, recursive helper method for findAllThreaded.
> >  *
> >  * @param array $data Results of find operation
> >  * @param string $root NULL or id for root node of operation
> >  * @param integer $index last processed index of $data
> >  * @return array Threaded results
> >  * @access private
> >  * @see Model::findAllThreaded()
> >  */
> > The way to fix it is dont keeping the last processed index, but the
> > processeds indexes... I guess.
> >
> > There is a ticket invalidated by phpnut. Why?
> https://trac.cakephp.org/ticket/3924
> >
> > I opened the ticket with new information.
> >
> > --
> > Renan Gonçalves - Software Engineer
> > Cell Phone: +55 11 8633 6018
> > MSN: [EMAIL PROTECTED]
> > São Paulo - SP/Brazil
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug with findAllThreaded

2008-04-18 Thread Sourabh Sharma

Hello,

But I use that findAllThreaded its works fine for me. But we have to
only take care about parent id  relationship. I followed the
instruction from manual. Or may be there is difference of versions. I
am using betaversion of cakephp.

I folowed the instruction from this

http://docs.cakephp.nu/discuss/show/Model/findAllThreaded

Thanks
Sourabh Sharma

Renan Gonçalves wrote:

> Hello,
>
> I was trying the method findAllThreaded and I have found a bug!
> I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too.
> There is a table called sections (model Section) with id, parent_id,
> created, modified and name.
>
> When I try to sort this data with $sections =
> $this->Section->findAllThreaded(null, null, 'Section.name ASC'); the result
> is only one Section, but there are 5.
> The only way to get all data is sorting by modified field.
>
> The problem is in:
> /**
>  * Private, recursive helper method for findAllThreaded.
>  *
>  * @param array $data Results of find operation
>  * @param string $root NULL or id for root node of operation
>  * @param integer $index last processed index of $data
>  * @return array Threaded results
>  * @access private
>  * @see Model::findAllThreaded()
>  */
> The way to fix it is dont keeping the last processed index, but the
> processeds indexes... I guess.
>
> There is a ticket invalidated by phpnut. Why?
> https://trac.cakephp.org/ticket/3924
>
> I opened the ticket with new information.
>
> --
> Renan Gon�alves - Software Engineer
> Cell Phone: +55 11 8633 6018
> MSN: [EMAIL PROTECTED]
> S�o Paulo - SP/Brazil

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug with findAllThreaded

2008-04-17 Thread Adam Royle

It was closed because there was no reproducable test case attached to
the ticket.

On Apr 18, 12:59 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I was trying the method findAllThreaded and I have found a bug!
> I have been tested this in Cake 1.2, but problaly the bug is on 1.1 too.
> There is a table called sections (model Section) with id, parent_id,
> created, modified and name.
>
> When I try to sort this data with $sections =
> $this->Section->findAllThreaded(null, null, 'Section.name ASC'); the result
> is only one Section, but there are 5.
> The only way to get all data is sorting by modified field.
>
> The problem is in:
> /**
>  * Private, recursive helper method for findAllThreaded.
>  *
>  * @param array $data Results of find operation
>  * @param string $root NULL or id for root node of operation
>  * @param integer $index last processed index of $data
>  * @return array Threaded results
>  * @access private
>  * @see Model::findAllThreaded()
>  */
> The way to fix it is dont keeping the last processed index, but the
> processeds indexes... I guess.
>
> There is a ticket invalidated by phpnut. 
> Why?https://trac.cakephp.org/ticket/3924
>
> I opened the ticket with new information.
>
> --
> Renan Gonçalves - Software Engineer
> Cell Phone: +55 11 8633 6018
> MSN: [EMAIL PROTECTED]
> São Paulo - SP/Brazil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug in Tree Behavior (fixed)

2008-04-15 Thread Adam Royle

You will get more response if you write up a solid test case and
submit it to trac.

On Apr 15, 7:45 pm, wirtsi <[EMAIL PROTECTED]> wrote:
> Hello ...
>
> I think I found a bug in the tree behavior class (SVN 6661) .. it is
> triggered when deleting the last (ie bottom node) of a MPTT tree.
>
> Data would be
> INSERT INTO `pipelines` (`id`, `parent_id`, `name`, `useraction_id`,
> `lft`, `rgt`) VALUES
> (1, NULL, 'FRONT', 1, 1, 20),
> (2, 1, 'FRONT', 26, 2, 19),
> (3, 2, 'FRONT', 27, 3, 8),
> (4, 2, 'FRONT', 28, 9, 14),
> (5, 2, 'FRONT', 29, 15, 18),
> (6, 3, 'FRONT', 30, 4, 7),
> (7, 4, 'FRONT', 30, 10, 13),
> (8, 5, 'FRONT', 31, 16, 17),
> (9, 7, 'FRONT', 31, 11, 12),
> (10, 6, 'FRONT', 31, 5, 6);
>
> So when I try to delete ID 8 for example (removefromtree(8,true)) the
> method should return after (line 529)
>
> if ($node[$right] == $node[$left] + 1) {
> if ($delete) {
> $model->delete();
> return true;
> } else {
> return false;
> }
>
> otherwise the beforeDelete gets called twice and the right values
> don't match any more.
>
> Am I missing something or is this really a bug?
>
> Wirtsi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with default controller 1.x

2008-04-13 Thread gmwebs

If you have enabled Cake Admin Routing, when you navigate to 
www.mysite.com/admin
Cake expects you to be trying to perform an Admin action within one of
your controllers. So if you had a Posts controller and an action
admin_delete in it, if you browsed to www.mysite.com/admin/posts/delete
then Cake would route you to the admin_delete action in your Posts
controller.

The reason you are seeing the error in your post above is because you
have not provided a controller/admin_action pair for the Cake Admin
Route to work with - in essence you have provided a blank controller
name which is what the error is saying.

If you want an admin page for your website, then you would need to add
a route in routes.php to point /admin to some or other controller
which will contain all your admin functions. i.e. Router::connect('/
admin', array('controller' => 'siteAdmin', 'action' => 'index'));

Then all requests to www.mysite.com/admin will go to the siteAdmin
controller, while all requests to 
www.mysite.com/admin/controllerName/adminAction
will still be routed to the relevant controller/admin_action pair.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug with default controller 1.x

2008-04-12 Thread jonknee

You probably don't want to name a controller
'controller' (redundant)... But beyond that, you'd have to name it
controller_controller.php.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug (maybe) report

2008-03-25 Thread Chris Hartjes

On Tue, Mar 25, 2008 at 12:48 AM, Raistlin Majere <[EMAIL PROTECTED]> wrote:
>
>  nevermind
>

That's what I thought when I read your post too.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bug (maybe) report

2008-03-24 Thread Raistlin Majere

nevermind

On 24 mar, 23:54, Raistlin Majere <[EMAIL PROTECTED]> wrote:
> echo $mode;
>
> if ($session->check('Account') && $mode != "rate" && !
> empty($all[$temporary_account_id]['articles']['mark']) &&
> $all[$temporary_account_id]['articles']['mark'])
> {
> echo $mode;
>
> echo ''.
> $subject.' [Modify] [Delete] '.
> $points.'';
>
> This code is echoing:
>
> rate
> no letter, no number, nothing
> Government a> 12
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread Baz

Need to stop banging your head nate, not really good for the frontal lobes.

I'm by no means a PHP expert. I also didn't think I need to debug the
code to figure out the 'subtle' different between autopopulation of
options vs. values. I'm telling you what I see from a beginner's
standpoint.

All I see is
$form->inpu() = data
$form->select() = no data

That oneline: $form->select("group_id", $groups); was the only thing I
needed, ThanX

As you can see from the replies, I'm not the only one who thought it
was a bit weird.

Y'all need to calm down man... lol

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread nate

*Bangs head against desk*.  I can't make this a whole lot clearer.
What I am telling you is this:

When you either:

(a) submit a form via POST, and you return to the form again
(let's say the submission doesn't validate)
*or*
(b) load a record into $this->data

Then:

FormHelper::select() uses said data to "auto-populate" the
VALUE of the select element, i.e. the initially-selected item
(take special note of the emphasis on the word "value").  This
behavior is consistently implemented across all form fields generated
by FormHelper.

What Does *Not* Happen:

   FormHelper::select() does not detect any view variables to
automatically use them in place of the $options parameter.

There is a subtle but important difference between select elements and
all other form elements generated by FormHelper: select elements are
the only ones that require a set of options when rendering.  No other
form element requires this.  Therefore, in order to maintain
consistency with other form field generator methods, no extra magic
functionality is used dealing with this list of options.

However, does that mean you have to use a high-level wrapper method
just to get a select element to display a list of options?  Heavens
no.  In fact, that would have been pretty retarded of me had I set it
up that way.  All you need to do is *use the method as it was
designed*, and pass it a parameter, like so:

$form->select("group_id", $groups);

Simple, clear, explicit.  Hardly worth a ticket.

Hey, that rhymes.

On Mar 4, 2:49 pm, Baz <[EMAIL PROTECTED]> wrote:
> I understand that they're not supposed to do the same thing. However,
> I can assure you that a $form->select('group_id') does not get
> populated. Not sure what the issue is.
>
> I discovered this while trying to used a select list without a label.
> I was forced to use: $form->input('group_id', array('type' =>
> 'select', 'label' => false));
>
> Granted, I haven't debugged through the code:
>
> This is what I've done:
> Bake a basic set controllers and views from User with a belongsTo on Group.
>
> On the add/edit I simply change $form->input('group_id') to
> $form->select('groupd_id').
> The select list is empty.
>
> All I know is that it if I change $form->input('group_id') to
> $form->text('group_id') it is populated, however select has an empty
> drop down list. Not really sure what else to tell you.
>
> I'm not sure what the expected behavior is, but what I expect (based
> on other form furctions) doesn't seem to be happening. If my
> expectation is unreasonable then there should be some mention in the
> book.cakephp.org with specific reference to why this shouldn't work
> with select boxes.
>
> Again, I'm using 6311 beta.
>
> Already filed an enhancement ticket:https://trac.cakephp.org/ticket/4270
>
> On Tue, Mar 4, 2008 at 1:19 PM, nate <[EMAIL PROTECTED]> wrote:
>
> >  $form->select (and therefore $form->input("...", array("type" =>
> >  "select)); by extension) *are* populated from $this->data, just like
> >  everything else (i.e. all other form field types).  The only thing
> >  different about a select input field is the need to generate available
> >  options.  That's where you're getting confused: the $options parameter
> >  in FormHelper::select() has no parallel in any other form field.
> >  Since $form->select() is a base method and not a wrapper method, it
> >  does not utilize any more magic than necessary.
>
> >  On Mar 4, 1:17 pm, Baz <[EMAIL PROTECTED]> wrote:
> >  > I don't think I'm talking bout POST data. I'm taking about, through
> >  > setting a variable via $this->MyModel->find('list').
>
> >  > All the other fields get set directly through $this->data. However,
> >  > I'm talking specifically about:
>
> >  > $this->select('group_id')
>
> >  > as compared to:
> >  > $this->input('group_id', array('type' => 'select')) does.
>
> > > On Tue, Mar 4, 2008 at 9:03 AM, nate <[EMAIL PROTECTED]> wrote:
>
> >  > >  $form->select() *does* auto-populate... from POST data.  Just like
> >  > >  everything else.  So no, this is not a bug.  The non-wrapper methods
> >  > >  keep the magic to a necessary minimum.
>
> >  > >  On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
> >  > >  > Well, that's my question:
>
> >  > >  > Is this is bug (oversight)? $form->text, $form->checkbox both
> >  > >  > autofill, so should I report this?
>
> >  > >  > On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> 
> > wrote:
>
> >  > >  > >  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>
> >  > >  > >  >  I take it you meant:
> >  > >  > >  >  $form->select('groups')?
>
> >  > >  > >  $groups = $this->MyModel->find('list')
> >  > >  > >  $this->set(compact('groups'));
>
> >  > >  > >  Is what I was thinking, but I don't think FormHelper::select 
> > supports
> >  > >  > >  the auto finding of the options array like input does, if you 
> > look at
> >  > >  > >  the code from the api
>
> >  > >  > >  http://api.cakephp.org/1.2/f

Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread Baz

I understand that they're not supposed to do the same thing. However,
I can assure you that a $form->select('group_id') does not get
populated. Not sure what the issue is.

I discovered this while trying to used a select list without a label.
I was forced to use: $form->input('group_id', array('type' =>
'select', 'label' => false));

Granted, I haven't debugged through the code:

This is what I've done:
Bake a basic set controllers and views from User with a belongsTo on Group.

On the add/edit I simply change $form->input('group_id') to
$form->select('groupd_id').
The select list is empty.

All I know is that it if I change $form->input('group_id') to
$form->text('group_id') it is populated, however select has an empty
drop down list. Not really sure what else to tell you.

I'm not sure what the expected behavior is, but what I expect (based
on other form furctions) doesn't seem to be happening. If my
expectation is unreasonable then there should be some mention in the
book.cakephp.org with specific reference to why this shouldn't work
with select boxes.

Again, I'm using 6311 beta.

Already filed an enhancement ticket:
https://trac.cakephp.org/ticket/4270

On Tue, Mar 4, 2008 at 1:19 PM, nate <[EMAIL PROTECTED]> wrote:
>
>  $form->select (and therefore $form->input("...", array("type" =>
>  "select)); by extension) *are* populated from $this->data, just like
>  everything else (i.e. all other form field types).  The only thing
>  different about a select input field is the need to generate available
>  options.  That's where you're getting confused: the $options parameter
>  in FormHelper::select() has no parallel in any other form field.
>  Since $form->select() is a base method and not a wrapper method, it
>  does not utilize any more magic than necessary.
>
>
>  On Mar 4, 1:17 pm, Baz <[EMAIL PROTECTED]> wrote:
>  > I don't think I'm talking bout POST data. I'm taking about, through
>  > setting a variable via $this->MyModel->find('list').
>  >
>  > All the other fields get set directly through $this->data. However,
>  > I'm talking specifically about:
>  >
>  > $this->select('group_id')
>  >
>  > as compared to:
>  > $this->input('group_id', array('type' => 'select')) does.
>  >
>
> > On Tue, Mar 4, 2008 at 9:03 AM, nate <[EMAIL PROTECTED]> wrote:
>  >
>  > >  $form->select() *does* auto-populate... from POST data.  Just like
>  > >  everything else.  So no, this is not a bug.  The non-wrapper methods
>  > >  keep the magic to a necessary minimum.
>  >
>  > >  On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
>  > >  > Well, that's my question:
>  >
>  > >  > Is this is bug (oversight)? $form->text, $form->checkbox both
>  > >  > autofill, so should I report this?
>  >
>  > >  > On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> 
> wrote:
>  >
>  > >  > >  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>  >
>  > >  > >  >  I take it you meant:
>  > >  > >  >  $form->select('groups')?
>  >
>  > >  > >  $groups = $this->MyModel->find('list')
>  > >  > >  $this->set(compact('groups'));
>  >
>  > >  > >  Is what I was thinking, but I don't think FormHelper::select 
> supports
>  > >  > >  the auto finding of the options array like input does, if you look 
> at
>  > >  > >  the code from the api
>  >
>  > >  > >  http://api.cakephp.org/1.2/form_8php-source.html#l00491around line
>
> > >  > >  535 you'll see where that is autofilled from
>  >
>  > >  > >  in FormHelper::select
>  > >  > >  http://api.cakephp.org/1.2/form_8php-source.html#l01002you can see
>
>
> > >  > >  that there is no similar feature.  So if you want it to work like
>  > >  > >  input you probably need to file an enhancement ticket
>  >
>  > >  > >  --
>  > >  > >  --
>  >
>  > >  > > (the old fart) the advice is free, the lack of crankiness will cost 
> you
>  >
>  > >  > >  - its a fine line between a real question and an idiot
>  >
>  > >  > >  
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>  > >  > >  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
>  > >  > >  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread nate

$form->select (and therefore $form->input("...", array("type" =>
"select)); by extension) *are* populated from $this->data, just like
everything else (i.e. all other form field types).  The only thing
different about a select input field is the need to generate available
options.  That's where you're getting confused: the $options parameter
in FormHelper::select() has no parallel in any other form field.
Since $form->select() is a base method and not a wrapper method, it
does not utilize any more magic than necessary.

On Mar 4, 1:17 pm, Baz <[EMAIL PROTECTED]> wrote:
> I don't think I'm talking bout POST data. I'm taking about, through
> setting a variable via $this->MyModel->find('list').
>
> All the other fields get set directly through $this->data. However,
> I'm talking specifically about:
>
> $this->select('group_id')
>
> as compared to:
> $this->input('group_id', array('type' => 'select')) does.
>
> On Tue, Mar 4, 2008 at 9:03 AM, nate <[EMAIL PROTECTED]> wrote:
>
> >  $form->select() *does* auto-populate... from POST data.  Just like
> >  everything else.  So no, this is not a bug.  The non-wrapper methods
> >  keep the magic to a necessary minimum.
>
> >  On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
> >  > Well, that's my question:
>
> >  > Is this is bug (oversight)? $form->text, $form->checkbox both
> >  > autofill, so should I report this?
>
> >  > On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> >  > >  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>
> >  > >  >  I take it you meant:
> >  > >  >  $form->select('groups')?
>
> >  > >  $groups = $this->MyModel->find('list')
> >  > >  $this->set(compact('groups'));
>
> >  > >  Is what I was thinking, but I don't think FormHelper::select supports
> >  > >  the auto finding of the options array like input does, if you look at
> >  > >  the code from the api
>
> >  > >  http://api.cakephp.org/1.2/form_8php-source.html#l00491around line
> >  > >  535 you'll see where that is autofilled from
>
> >  > >  in FormHelper::select
> >  > >  http://api.cakephp.org/1.2/form_8php-source.html#l01002you can see
> >  > >  that there is no similar feature.  So if you want it to work like
> >  > >  input you probably need to file an enhancement ticket
>
> >  > >  --
> >  > >  --
>
> >  > > (the old fart) the advice is free, the lack of crankiness will cost you
>
> >  > >  - its a fine line between a real question and an idiot
>
> >  > >  
> > http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
> >  > >  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
> >  > >  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread Baz

I don't think I'm talking bout POST data. I'm taking about, through
setting a variable via $this->MyModel->find('list').

All the other fields get set directly through $this->data. However,
I'm talking specifically about:

$this->select('group_id')

as compared to:
$this->input('group_id', array('type' => 'select')) does.


On Tue, Mar 4, 2008 at 9:03 AM, nate <[EMAIL PROTECTED]> wrote:
>
>  $form->select() *does* auto-populate... from POST data.  Just like
>  everything else.  So no, this is not a bug.  The non-wrapper methods
>  keep the magic to a necessary minimum.
>
>
>  On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
>  > Well, that's my question:
>  >
>  > Is this is bug (oversight)? $form->text, $form->checkbox both
>  > autofill, so should I report this?
>  >
>  > On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
> >
>  > >  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>  >
>  > >  >  I take it you meant:
>  > >  >  $form->select('groups')?
>  >
>  > >  $groups = $this->MyModel->find('list')
>  > >  $this->set(compact('groups'));
>  >
>  > >  Is what I was thinking, but I don't think FormHelper::select supports
>  > >  the auto finding of the options array like input does, if you look at
>  > >  the code from the api
>  >
>  > >  http://api.cakephp.org/1.2/form_8php-source.html#l00491 around line
>  > >  535 you'll see where that is autofilled from
>  >
>  > >  in FormHelper::select
>  > >  http://api.cakephp.org/1.2/form_8php-source.html#l01002 you can see
>  > >  that there is no similar feature.  So if you want it to work like
>  > >  input you probably need to file an enhancement ticket
>  >
>  > >  --
>  > >  --
>  >
>  > > (the old fart) the advice is free, the lack of crankiness will cost you
>  >
>  > >  - its a fine line between a real question and an idiot
>  >
>  > >  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>  > >  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
>  > >  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-04 Thread nate

$form->select() *does* auto-populate... from POST data.  Just like
everything else.  So no, this is not a bug.  The non-wrapper methods
keep the magic to a necessary minimum.

On Mar 4, 1:56 am, Baz <[EMAIL PROTECTED]> wrote:
> Well, that's my question:
>
> Is this is bug (oversight)? $form->text, $form->checkbox both
> autofill, so should I report this?
>
> On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> >  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>
> >  >  I take it you meant:
> >  >  $form->select('groups')?
>
> >  $groups = $this->MyModel->find('list')
> >  $this->set(compact('groups'));
>
> >  Is what I was thinking, but I don't think FormHelper::select supports
> >  the auto finding of the options array like input does, if you look at
> >  the code from the api
>
> >  http://api.cakephp.org/1.2/form_8php-source.html#l00491 around line
> >  535 you'll see where that is autofilled from
>
> >  in FormHelper::select
> >  http://api.cakephp.org/1.2/form_8php-source.html#l01002 you can see
> >  that there is no similar feature.  So if you want it to work like
> >  input you probably need to file an enhancement ticket
>
> >  --
> >  --
>
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> >  - its a fine line between a real question and an idiot
>
> >  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
> >  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
> >  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-03 Thread Baz

Well, that's my question:

Is this is bug (oversight)? $form->text, $form->checkbox both
autofill, so should I report this?

On Tue, Mar 4, 2008 at 12:34 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>  On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>  >
>  >  I take it you meant:
>  >  $form->select('groups')?
>  >
>  $groups = $this->MyModel->find('list')
>  $this->set(compact('groups'));
>
>  Is what I was thinking, but I don't think FormHelper::select supports
>  the auto finding of the options array like input does, if you look at
>  the code from the api
>
>  http://api.cakephp.org/1.2/form_8php-source.html#l00491  around line
>  535 you'll see where that is autofilled from
>
>  in FormHelper::select
>  http://api.cakephp.org/1.2/form_8php-source.html#l01002  you can see
>  that there is no similar feature.  So if you want it to work like
>  input you probably need to file an enhancement ticket
>
>  --
>  --
>
>
> (the old fart) the advice is free, the lack of crankiness will cost you
>
>  - its a fine line between a real question and an idiot
>
>  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
>  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-03 Thread Samuel DeVore

On Mon, Mar 3, 2008 at 11:24 PM, Baz <[EMAIL PROTECTED]> wrote:
>
>  I take it you meant:
>  $form->select('groups')?
>
$groups = $this->MyModel->find('list')
$this->set(compact('groups'));

Is what I was thinking, but I don't think FormHelper::select supports
the auto finding of the options array like input does, if you look at
the code from the api

http://api.cakephp.org/1.2/form_8php-source.html#l00491  around line
535 you'll see where that is autofilled from

in FormHelper::select
http://api.cakephp.org/1.2/form_8php-source.html#l01002  you can see
that there is no similar feature.  So if you want it to work like
input you probably need to file an enhancement ticket

-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-03 Thread Baz

I take it you meant:
$form->select('groups')?

That doesn't work either.


On Tue, Mar 4, 2008 at 12:19 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>  try groups
>
>
>
>  On Mon, Mar 3, 2008 at 11:07 PM, Baz <[EMAIL PROTECTED]> wrote:
>  >
>  >  Stumbled onto this, hoping someone could guide me as to what is the
>  >  expected behavior before I file a ticket in trac:
>  >
>  >  Trying to add a select drop down list:
>  >
>  >  Let's assume, we have a simple model with a belongs_to Group, he we
>  >  have a group_id.
>  >  //controller:
>  >  $group = $this->MyModel->find('list')
>  >  $this->set(compact('group'));
>  >
>  >  //veiw:
>  >  // This works fine:
>  >  $form->input('group_id')
>  >
>  >  // This does not populate the data:
>  >  $form->select('group_id');
>  >
>  >  >
>  >
>
>
>
>  --
>  --
>  (the old fart) the advice is free, the lack of crankiness will cost you
>
>  - its a fine line between a real question and an idiot
>
>  http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
>  http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
>  http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug? - $form->select() doesn't populate data, but $form->input() does

2008-03-03 Thread Samuel DeVore

try groups

On Mon, Mar 3, 2008 at 11:07 PM, Baz <[EMAIL PROTECTED]> wrote:
>
>  Stumbled onto this, hoping someone could guide me as to what is the
>  expected behavior before I file a ticket in trac:
>
>  Trying to add a select drop down list:
>
>  Let's assume, we have a simple model with a belongs_to Group, he we
>  have a group_id.
>  //controller:
>  $group = $this->MyModel->find('list')
>  $this->set(compact('group'));
>
>  //veiw:
>  // This works fine:
>  $form->input('group_id')
>
>  // This does not populate the data:
>  $form->select('group_id');
>
>  >
>



-- 
-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
http://blog.samdevore.com/cakephp-pages/i-cant-bake/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug while using PHPmailer

2008-02-13 Thread djiize

if you want to use the core component, delete or move/rename your own
email.php component. It overrides the core's one

On 13 fév, 16:02, djiize <[EMAIL PROTECTED]> wrote:
> good start to Email core component:http://book.cakephp.org/view/176/email
>
> On 13 fév, 15:41, searchmax <[EMAIL PROTECTED]> wrote:
>
> > Hi djiize,
>
> > Thanks a ton i have resolved that bug. Actually there is a space after
> > the (?>) closing tag and after removing that my code is working fine..
> > Thankyou very much for your help:-)
>
> > djiize wrote:
>
> > > in your email.php component file, check if there's nothing after
> > > closing tag (?>)
> > > and FYI, there's an Email core component in Cake
>
> > > On 13 fév, 11:04, searchmax <[EMAIL PROTECTED]> wrote:
> > >> My code was working fine with sessions but when i added the
> > >> email(phpmailer),
> > >> I am getting the below error when i use email(phpmailer) component and
> > >> checking the session
>
> > >> If i comment var $components = array('Email');, everything works fine.
> > >> Pls
> > >> help me in this regard
>
> > >> CODE
>
> > >>  > >> class ProductsController extends AppController
> > >> {
>
> > >> var $helpers = array("html","Javascript");
>
> > >> var $components = array('Email');
>
> > >> function beforeFilter()
> > >> {
> > >> $this->checkSession();
> > >> }
> > >> //rest of the code
>
> > >> Error
> > >> Warning: Cannot modify header information - headers already sent by
> > >> (output
> > >> started at
> > >> C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116)
> > >> in
> > >> C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on
> > >> line
> > >> 447
>
> > >> --
> > >> View this message in
> > >> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html
> > >> Sent from the CakePHP mailing list archive at Nabble.com.
>
> > --
> > View this message in 
> > context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html
> > Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug while using PHPmailer

2008-02-13 Thread djiize

good start to Email core component:
http://book.cakephp.org/view/176/email

On 13 fév, 15:41, searchmax <[EMAIL PROTECTED]> wrote:
> Hi djiize,
>
> Thanks a ton i have resolved that bug. Actually there is a space after
> the (?>) closing tag and after removing that my code is working fine..
> Thankyou very much for your help:-)
>
>
>
> djiize wrote:
>
> > in your email.php component file, check if there's nothing after
> > closing tag (?>)
> > and FYI, there's an Email core component in Cake
>
> > On 13 fév, 11:04, searchmax <[EMAIL PROTECTED]> wrote:
> >> My code was working fine with sessions but when i added the
> >> email(phpmailer),
> >> I am getting the below error when i use email(phpmailer) component and
> >> checking the session
>
> >> If i comment var $components = array('Email');, everything works fine.
> >> Pls
> >> help me in this regard
>
> >> CODE
>
> >>  >> class ProductsController extends AppController
> >> {
>
> >> var $helpers = array("html","Javascript");
>
> >> var $components = array('Email');
>
> >> function beforeFilter()
> >> {
> >> $this->checkSession();
> >> }
> >> //rest of the code
>
> >> Error
> >> Warning: Cannot modify header information - headers already sent by
> >> (output
> >> started at
> >> C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116)
> >> in
> >> C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on
> >> line
> >> 447
>
> >> --
> >> View this message in
> >> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html
> >> Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> View this message in 
> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >