Re: Cannot figure out why redirect is not working at all.

2012-03-02 Thread andrewperk
Is the $formulaId being passed in through the URL?

If so, I believe that the $formulaId variable is only available in
your action when the page is first requested via the get request. Once
the page is submitted with the form and it's doing a post request it
no longer has $formulaId being passed in through the URL at that
point. It's passing in the form data to the edit action not the URL
data.

Try just redirecting to a static page like a home or contact page
after the save to see if the redirect works or if its the ID that
you're passing to it is the error.

I'm not sure why it's taking you to an entirely different URL though.

On Mar 1, 7:43 pm, bbowler86  wrote:
> So I have a materials controller and I am trying to save the weight of a
> material and then redirect to the instructions action in the formulas
> controller. I know its getting to the
>
>  if($this->request->is('post')) {
>
> IF/Then construct because I have put echoes in it but after it saves it
> ends up not redirecting and just goes to a blank page where the URL is
>
> /formulas/edit/2
>
> which makes it seem like its just truncating the formulasId from the URL.
> When it gets to that point it shows up blank and when I view
>
> Here is my code below:
>
> function edit($id = null, $formulaId = null) {
>         $this->Formula->id = $id;
>         $this->Formula->formulaId = $formulaId;
>         $this->set('formulasId', $this->Formula->formulaId);
>         if($this->request->is('post')) {
>                 $this->Formula->save($this->request->data);
>                 $this->redirect('/formulas/instructions/' . $formulaId);
>
>         }
>         if($this->request->is('get')) {
>             debug($this->data);
>             $this->request->data = $this->Formula->read();
>         } else if($this->Formula->save($this->request->data)) {
>             $this->redirect(array('action' => 'instructions', $formulaId));
>         }
>     }
>
> My view is:
>
>      echo $this->Form->create('Formula', array('action' => 'edit'));
>     echo $this->Form->input('weight');
>     echo $this->Form->input('id', array('type' => 'hidden'));
>     echo $this->Form->input('formulasId', array('type' => 'hidden'));
>     echo $this->Form->end('Save');?>

-- 
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: Failed Deployment

2012-03-02 Thread John Hardy
Try clearing your sites schema cache.

It's located in the tmp directory of your app folder.


On Mar 2, 2012, at 10:04 PM, Michael Gaiser wrote:

> So I have been working on a site for a while now on my laptop (localhost) and 
> things pretty much worked the way I would expect. But when I tried to deploy 
> it to my host and thats where my problems started. When I go to my site, a 
> blank page shows up, even though the redirect to /users/login does take 
> place. I ran a few tests and the database info is being set even though my 
> error log says that "Unknown column 'user.id' in 'where clause'" from the 
> dbo_source.php.
> 
> 
> That table does exist so I am kind of at a loss here. Anyone have any 
> suggestions about where to look next? Thanks in advance.
> 
> 
> ~MG
> 
> -- 
> 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

-- 
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


Failed Deployment

2012-03-02 Thread Michael Gaiser
So I have been working on a site for a while now on my laptop (localhost)
and things pretty much worked the way I would expect. But when I tried to
deploy it to my host and thats where my problems started. When I go to my
site, a blank page shows up, even though the redirect to /users/login does
take place. I ran a few tests and the database info is being set even
though my error log says that "Unknown column 'user.id' in 'where clause'"
from the dbo_source.php.


That table does exist so I am kind of at a loss here. Anyone have any
suggestions about where to look next? Thanks in advance.


~MG

-- 
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: WordPress query_posts on a CakePHP page?

2012-03-02 Thread bujanga
You basically have to load the WordPress "framework" to use their wp
specific functions. See this link:
http://www.digimantra.com/tutorials/wordpress/display-wordpress-post-content-wordpress/

Personally, I don't think I would do it this way. Instead, maybe a
direct query to the database or use some of the wordpress RPC, or even
more generically, RSS.

Gary

-- 
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: WordPress query_posts on a CakePHP page?

2012-03-02 Thread 85VicWagonGuy
FYI   whereweroll.com is an Evento calendar app, done in CakePHP.

-- 
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: Insert generated fields into database

2012-03-02 Thread jeremyharris
No problem. Enjoy Cake!

On Friday, March 2, 2012 1:09:16 PM UTC-8, Graham wrote:
>
> Thanks, so simple when you know how.
>
> Cheers
>
> Gj
>

-- 
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


WordPress query_posts on a CakePHP page?

2012-03-02 Thread 85VicWagonGuy
This code displays the last 3 Wordpress posts in normal PHP:











==

How do we do this in CakePHP?

I need posts from http://www.whereweroll.com/blog/ to appear on the
http://www.whereweroll.com homepage.

The KyleRobinsonYoung instructions aren't complete, and he is done
freelancing.

Thanks.

-- 
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: MeioUpload strange error on the remote server

2012-03-02 Thread Salines
Fix: https://github.com/jrbasso/MeioUpload/issues/87#issuecomment-1703200

-- 
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: Insert generated fields into database

2012-03-02 Thread Graham
Thanks, so simple when you know how.

Cheers

Gj

-- 
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: isAuthorized redirect

2012-03-02 Thread daf182
Hi,

You can setup where to go after login or in case of failure.
Check this part of the documentation:
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html?highlight=isauthorized
 

Especially this part: AuthComponent API

2012. március 1., csütörtök 0:31:34 UTC+1 időpontban JT a következőt írta:
>
> I'm using isAuthorized to check if the user is an admin or a user. If a 
> user tries to access an admin function I want them to be redirected to the 
> previous page. However when isAuthorized returns false the user is 
> redirected to '/'. How can I change this behaviour?

-- 
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: MenuBuilder doesn't work with cakephp 2.0 (or 2.1)

2012-03-02 Thread Rob
The 2.0 branch on github does in fact work with 2.1 RC.  The correct 
location for the files is app/Plugin/MenuBuilder.  It looks like your 
problem is how you're adding it to the helpers array.  The key should be 
"MenuBuilder.MenuBuilder", which tells Cake to look in a plugin called 
MenuBuilder for a helper also called MenuBuilder.

- Rob

On Monday, February 27, 2012 5:11:49 AM UTC-5, Thomas wrote:
>
> I think he is talking about https://github.com/torifat/cake-menu_builder 
>
> I'm also trying to get this working with 2.1, but keep getting 
> different kinds of errors, depending on where I put the menu builder 
> php file 
>
> Seems like the author was working on a 2.0 compatible build (there is 
> a 2.0 branch on github), but last activity is 2 months ago. 
>
> This consist of a MenuBuilderHelper.php 
>
> When I put this under app/view/helper, I get "plugin not found" 
> When I put it under app/plugin/menuBuilder, I get "Helper class 
> MenuBuilderHelper could not be found." 
>
> Is there another menu plugin available that is working with the 
> current build (2.1 rc1) 
>
> Tom 
>
> On 4 Jan., 21:15, euromark  wrote: 
> > first of all you are not giving us any links or code etc 
> > kinda hard to help you without anything concrete to go on 
>

-- 
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: actsAs ignored in plugin model

2012-03-02 Thread Tilen Majerle
i'm not sure, but you have to load Tags plugin too with CakePlugin::load();
:)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/3/2 lorenzo 

> hi bakers, i'm in trouble with a plugin model that don't get actsAs in the
> program flow.
> The scenario:  model Foo in Moo Plugin. I want use tags plugin
> http://cakedc.com/downloads/view/cakephp_tags_plugin.
>
> cake don't catch the actsAs and if i debug the model in the controller (
> print_r($Foo); ), the actsAs variable is null!
>
> the code:
>
> class Foo extends MooAppModel
> {
> var $name = 'PointRoute';
> var $actsAs = array(
> 'Tags.Taggable' => array(
>  'separator' => ',',
> 'field' => 'tags',
> 'tagAlias' => 'Tag',
>  'tagClass' => 'Tags.Tag',
> 'taggedClass' => 'Tags.Tagged',
> 'foreignKey' => 'foreign_key',
>  'associationForeignKey' => 'tag_id',
> 'cacheWeight' => true,
> 'automaticTagging' => true,
>  'unsetInAfterFind' => false,
> 'resetBinding' => false)
> );
> }
>
> thanks!
>
> --
> 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
>

-- 
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: Insert generated fields into database

2012-03-02 Thread jeremyharris
You can just add it to the data you save in the controller action. 
Something like:

function add() {
if (!empty($this->data)) {
$this->data['Model']['amount_plus_fee'] = $this->data['Model']['amount'] + 
10;
$this->Model->save($this->data);
}
}

So amount_plus_fee wouldn't be in the form necessarily, but it's a field on 
the table that you save here.

On Friday, March 2, 2012 10:46:50 AM UTC-8, Graham wrote:
>
> Hi, I am extremely new to CakePHP and I have a requirement that I 
> cannot see how to resolve. 
>
> I have been through the tutorials and searched the web for a solution 
> but cannot find an answer. It might be that I am not searching for the 
> right thing - I hope someone can point me in the right direction. 
>
> I can add a new record into a database from a form without problem. I 
> would like to add data to a database field that I generate based on 
> some other information - not from the form. The data will be based 
> upon some values from the form plus a sequence number. 
>
> I guess I could do it in an extra write but that is wasteful on 
> resources. I would like to add the extra data in the same statement as 
> the data form the form if that is possible. 
>
> This is sounding more complicated as I write it down but I hope 
> someone can decypher my needs!! 
>
> Thanks in advance for your assistance. 
>
> Graham

-- 
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


Insert generated fields into database

2012-03-02 Thread Graham
Hi, I am extremely new to CakePHP and I have a requirement that I
cannot see how to resolve.

I have been through the tutorials and searched the web for a solution
but cannot find an answer. It might be that I am not searching for the
right thing - I hope someone can point me in the right direction.

I can add a new record into a database from a form without problem. I
would like to add data to a database field that I generate based on
some other information - not from the form. The data will be based
upon some values from the form plus a sequence number.

I guess I could do it in an extra write but that is wasteful on
resources. I would like to add the extra data in the same statement as
the data form the form if that is possible.

This is sounding more complicated as I write it down but I hope
someone can decypher my needs!!

Thanks in advance for your assistance.

Graham

-- 
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


MeioUpload strange error on the remote server

2012-03-02 Thread Salines
Hello, 

after upgrading site to cakephp 2.1 i found some problems with uploading 
files on the remote server. On localhost site works without problems, but 
if i try to upload images to the  live site i have  this error message.

###

*Warning* (2): file_get_contents(/phpsbzxKk) [function.file-get-contents]: 
failed to open stream: No such file or directory [*CORE/Cake/Utility/File.php*, 
line *159*]
Code Context

$bytes  =   false
$mode   =   'rb'
$force  =   false

file_get_contents - [internal], line ??
File::read() - CORE/Cake/Utility/File.php, line 159
MeioUploadBehavior::_copyFileFromTemp() - 
APP/Model/Behavior/MeioUploadBehavior.php, line 1048
MeioUploadBehavior::_uploadFile() - APP/Model/Behavior/MeioUploadBehavior.php, 
line 676
MeioUploadBehavior::upload() - APP/Model/Behavior/MeioUploadBehavior.php, line 
257
MeioUploadBehavior::beforeSave() - APP/Model/Behavior/MeioUploadBehavior.php, 
line 204
ObjectCollection::trigger() - CORE/Cake/Utility/ObjectCollection.php, line 130
call_user_func - [internal], line ??
CakeEventManager::dispatch() - CORE/Cake/Event/CakeEventManager.php, line 245
Model::save() - CORE/Cake/Model/Model.php, line 1642
ProductsController::admin_add() - APP/Controller/ProductsController.php, line 
138
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 484
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 104
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 86
[main] - APP/webroot/index.php, line 96

**Headers already sent in file 
"/home/detasba/public_html/lib/Cake/Utility/Debugger.php" on line "761", 
dumping error message as text:**

phpThumb() v1.7.11-201108081537
http://phpthumb.sourceforge.net

Unknown image type identified by "" () in SourceImageToGD() [3659]



Help me. Thanks 


-- 
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


actsAs ignored in plugin model

2012-03-02 Thread lorenzo
hi bakers, i'm in trouble with a plugin model that don't get actsAs in the 
program flow.
The scenario:  model Foo in Moo Plugin. I want use tags plugin 
http://cakedc.com/downloads/view/cakephp_tags_plugin.

cake don't catch the actsAs and if i debug the model in the controller ( 
print_r($Foo); ), the actsAs variable is null!

the code:

class Foo extends MooAppModel
{
var $name = 'PointRoute';
var $actsAs = array(
'Tags.Taggable' => array(
'separator' => ',',
'field' => 'tags',
'tagAlias' => 'Tag',
'tagClass' => 'Tags.Tag',
'taggedClass' => 'Tags.Tagged',
'foreignKey' => 'foreign_key',
'associationForeignKey' => 'tag_id',
'cacheWeight' => true,
'automaticTagging' => true,
'unsetInAfterFind' => false,
'resetBinding' => false)
);
}

thanks!

-- 
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


Simple Association... Is this possible?

2012-03-02 Thread Stephen
Associating models together between separate database configs... How
possible is it? Is it easily achieved by using unique_keys? Are the only
drawbacks extra strain on the mysql server and lack of inner join / more
queries?

PluginUserGroup belongsTo PluginUser

In rare scenarios, "User extends PluginUser" therefore, PluginUserGroup
belongsTo User... am I snookered to create "UserGroup extends
PluginUserGroup" ?

Cheers

-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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: CakePHP and Memcached

2012-03-02 Thread sixthpoint
memcached should have keys that expire, thus you wouldn't have to remove 
it. read this  http://api20.cakephp.org/class/memcache-engine 

On Friday, March 2, 2012 3:14:58 AM UTC-6, Almog Koren wrote:
>
> I'm looking at adding Memcached to my application I understand there is 
> already a built in option for this in CakePHP. I wanted to know if I'm 
> still required to build a caching layer were  I link the cache to a key 
> that represents the data in the database. and when it comes time to clear 
> it you just search for that key and remove it. Or is this already done via 
> CakePHP and I just need to add Memcached? 
>

-- 
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: Custom Helper inside CakeMail views

2012-03-02 Thread GB
Tilen,

Thanks..  I did RTM before I posted but completely missed the area on 
adding helpers.  I went back in and looked and there it was!  Duh..  Thanks 
again!

G

On Friday, March 2, 2012 2:03:04 AM UTC-5, MaJerle.Eu wrote:
>
>
> Read manual in cakephp book for cakeemail
> Dne petek, 02. marec 2012 je pošiljatelj GB  napisal:
> > I am using a custom Helper that renders my views along with some 
> standard view logic.  I'd like to use that same helper in emails I send 
> using v2.0 CakeMail component (e.g. send copy of web view contents to 
> customer in email).  However, when I reference that Helper I get an error 
> that it is not initialized.  How do I add a custom Helper to the CakeMail 
> component?
> >
> > Thanks!
> >
> > George
> >
> > --
> > 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
> >
>
> -- 
> --
> Lep pozdrav, Tilen Majerle
> http://majerle.eu
>
>

-- 
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


CakePHP and Memcached

2012-03-02 Thread Almog Koren
I'm looking at adding Memcached to my application I understand there is 
already a built in option for this in CakePHP. I wanted to know if I'm 
still required to build a caching layer were  I link the cache to a key 
that represents the data in the database. and when it comes time to clear 
it you just search for that key and remove it. Or is this already done via 
CakePHP and I just need to add Memcached? 

-- 
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