Oops bad reply On Dec 9, 10:35 am, Abba Bryant <[email protected]> wrote: > Elements included in the layout have known limitations in what they can add > to the scripts_for_layout variable. > > > > On Fri, Dec 9, 2011 at 8:56 AM, <[email protected]> wrote: > > Today's Topic Summary > > > Group:http://groups.google.com/group/cake-php/topics > > > - Strange updateCounterCache > > behavior<#13423c12231ff10c_group_thread_0>[6 Updates] > > - ACL RBAC <#13423c12231ff10c_group_thread_1> [2 Updates] > > - Multi-level Authorization? <#13423c12231ff10c_group_thread_2> [2 > > Updates]
> > - How to use AuthComponent to authorize using a password only rather > > than username/password? <#13423c12231ff10c_group_thread_3> [1 Update] > > - Store only month and date <#13423c12231ff10c_group_thread_4> [1 > > Update] > > - Model Test Case SQL Error <#13423c12231ff10c_group_thread_5> [1 > > Update] > > - Update field in associated > > model???<#13423c12231ff10c_group_thread_6>[1 Update] > > - meioupload sql error <#13423c12231ff10c_group_thread_7> [2 Updates] > > - Can a plugin component auto-load a > > helper<#13423c12231ff10c_group_thread_8>[2 Updates] > > - Flash in cakephp <#13423c12231ff10c_group_thread_9> [2 Updates] > > - Model: Query distinct values from a table then save those values to > > another table <#13423c12231ff10c_group_thread_10> [1 Update] > > - How to add a "read" button to a > > view.ctp?<#13423c12231ff10c_group_thread_11>[1 Update] > > - v2.0.4 Console error message on > > mkdir?<#13423c12231ff10c_group_thread_12>[1 Update] > > - Javascript Helper modification. Opinions, > > please.<#13423c12231ff10c_group_thread_13>[2 Updates] > > > Strange updateCounterCache > > behavior<http://groups.google.com/group/cake-php/t/a79de443a387d041> > > > avairet <[email protected]> Dec 09 08:07AM -0800 > > > Hi, > > > I'm using Cake 1.3.13. > > > I have an strange issue with counterCache, that I've never seen > > before. > > > So, I have Personality belongsTo User and Personality belongsTo > > Category associations: > > > public $belongsTo = array( > > 'Category' => array( > > 'className' => 'Category', > > 'foreignKey' => 'category_id', > > 'conditions' => '', > > 'fields' => '', > > 'order' => '', > > 'counterCache' => true, > > 'counterScope' => array('Personality.valid' => 1) > > ), > > 'User' => array( > > 'className' => 'User', > > 'foreignKey' => 'user_id', > > 'conditions' => '', > > 'fields' => '', > > 'order' => '', > > 'counterCache' => true, > > 'counterScope' => array('Personality.valid' => 1) > > ) > > ); > > > In my personalities and categories tables, I have a > > "personality_count" field (TINYINT). > > When I add a Personality and I set "valid" to 1, all is right, the > > counters are updated. > > > In my personality edit view, I have a checkbox to validate or > > invalidate the record (Personality.valid = 0 or 1). > > If I invalidate a personality, all is right, the counters are updated > > (- 1). > > But after that, if I validate the personality again, the counters > > don't change?! > > > What's the mistake? Thank's fo any idea. > > > By the way, why there is a "$created" param in > > Model::updateCounterCache() while it is never used inside the method?? > > > Avairet > > > Jeremy Burns | Class Outfit <[email protected]> Dec 09 > > 04:11PM > > > What's the data type and size of the counter fields? > > > Jeremy Burns > > Class Outfit > > > http://www.classoutfit.com > > > On 9 Dec 2011, at 16:07:53, avairet wrote: > > > avairet <[email protected]> Dec 09 08:15AM -0800 > > > Like I said : TINYINT(1) > > > On 9 déc, 17:11, Jeremy Burns | Class Outfit > > > avairet <[email protected]> Dec 09 08:17AM -0800 > > > Oh non sorry :) > > personality_count fields are INT(11) > > > Jeremy Burns | Class Outfit <[email protected]> Dec 09 > > 04:28PM > > > Your mail said: > > > In my personalities and categories tables, I have a > > "personality_count" field (TINYINT). > > > Are you sure? > > > Jeremy Burns > > Class Outfit > > > http://www.classoutfit.com > > > On 9 Dec 2011, at 16:17:33, avairet wrote: > > > avairet <[email protected]> Dec 09 08:37AM -0800 > > > No, it's an error. My fields are really INT(11). > > I'm using Cake since 4 years and using counterCache well. > > > On 9 déc, 17:28, Jeremy Burns | Class Outfit > > > ACL RBAC <http://groups.google.com/group/cake-php/t/c4e0f9b1168cfe22> > > > RhythmicDevil <[email protected]> Dec 09 07:11AM -0800 > > > Hi all, I am working on implementing RBAC using ACL. I am really close > > but I am getting an error and I am hoping you can shed some light on > > it. I have pasted my entire ACO and ARO trees below for reference. > > > When I run the following using the Cake console it works as expected: > > > [swright@swright-dev app]$ cake acl check Group.4 controllers/ > > Solidcores "*" > > Group.4 is allowed. > > > > > *************************************************************************** > > ************************ > > > However if I do this in my AppController::beforeFilter(): > > > var_dump('Acl Check Result', > > $this->Acl->check( > > 'Group.' . $this->Session->read('Auth.User.group_id'), > > 'controllers/' . $this->name, > > "*" > > ) > > ); > > > > > *************************************************************************** > > ************************ > > > I get the following output in my browser: > > > Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in > > permissions check. Node references: > > Aro: Group.4 > > Aco: controllers/Solidcores [CORE/cake/libs/controller/components/ > > acl.php, line 273] > > > string 'Acl Check Result' (length=16) > > > boolean false > > > > > *************************************************************************** > > ************************ > > > Shouldn't I get the same result? > > > > > *************************************************************************** > > ************************ > > ARO and ACO Tree dumps > > > [swright@swright-dev app]$ cake acl view aro > > Aro tree: > > --------------------------------------------------------------- > > [1] Group.4 > > [4] User.4 > > [7] User.7 > > [2] Group.5 > > [5] User.5 > > [3] Group.6 > > [6] User.6 > > --------------------------------------------------------------- > > [swright@swright-dev app]$ cake acl view aco > > Aco tree: > > --------------------------------------------------------------- > > [1] controllers > > [2] Pages > > [3] display > > [4] add > > [5] edit > > [6] index > > [7] view > > [8] delete > > [9] AnalystUi > > [10] index > > [11] add > > [12] edit > > [13] view > > [14] delete > > [15] ThreatCenter > > [16] index > > [17] add > > [18] edit > > [19] view > > [20] delete > > [21] GtiData > > [22] index > > [23] add > > [24] edit > > [25] view > > [26] delete > > [27] PocDemos > > [28] index > > [29] add > > [30] edit > > [31] view > > [32] delete > > [33] Projects > > [34] index > > [35] add > > [36] edit > > [37] view > > [38] delete > > [39] Products > > [40] index > > [41] add > > [42] edit > > [43] view > > [44] delete > > [45] Users > > [46] login > > [47] logout > > [48] index > > [49] view > > [50] add > > [51] edit > > [52] delete > > [53] Wam > > [54] index > > [55] add > > [56] edit > > [57] view > > [58] delete > > [59] Solidcores > > [60] index > > [61] processed_count > > [62] performance > > [63] add > > [64] edit > > [65] view > > [66] delete > > [67] ThreatVectors > > [68] index > > [69] add > > [70] edit > > [71] view > > [72] delete > > [73] Botnets > > [74] index > > [75] add > > [76] edit > > [77] view > > [78] delete > > [79] Tests > > [80] index > > [81] add > > [82] edit > > [83] view > > [84] delete > > [85] Groups > > [86] index > > [87] view > > [88] add > > [89] edit > > [90] delete > > [91] Main > > [92] index > > [93] add > > [94] edit > > [95] view > > [96] delete > > [97] GtiApi > > [98] index > > [99] add > > [100] edit > > [101] view > > [102] delete > > [103] Resources > > [104] index > > [105] add > > [106] edit > > [107] view > > [108] delete > > [109] Environments > > [110] index > > [111] add > > [112] edit > > [113] view > > [114] delete > > [115] Operations > > [116] index > > [117] add > > [118] edit > > [119] view > > [120] delete > > [121] Reports > > [122] index > > [123] add > > [124] edit > > [125] view > > [126] delete > > [127] GtiSdk > > [128] index > > [129] add > > [130] edit > > [131] view > > [132] delete > > > RhythmicDevil <[email protected]> Dec 09 08:11AM -0800 > > > A coworker just clued me in and this is the final statement in > > AppController::beforeFilter() > > > function beforeFilter() > > { > > /* > > * check(ARO, ACO, [action]) > > * > > */ > > if ($this->Acl->check(array('model' => 'Group', 'foreign_key' > > => $this->Session->read('Auth.User.group_id')), $this->name, '*')) > > { > > var_dump('Allowed'); > > } > > else > > { > > var_dump('Not Allowed'); > > } > > } > > > Multi-level > > Authorization?<http://groups.google.com/group/cake-php/t/2eb779a376694b94> > > > Wendall <[email protected]> Dec 09 07:04AM -0800 > > > I want to use cakePHP to set up an site that handles logging in users, > > etc, but I want 2 'roles': regular users that can access protected > > content as well as an 'admin' role that can create and administer > > other users. How can I use the Auth compoent to do this? > > > Jeremy Burns | Class Outfit <[email protected]> Dec 09 > > 03:32PM > > > By following the very clear tutorials in the online guide (they exists > > for both 1.3 and 2.n). > > > Jeremy Burns > > Class Outfit > > > http://www.classoutfit.com > > > On 9 Dec 2011, at 15:04:14, Wendall wrote: > > > How to use AuthComponent to authorize using a password only rather than > > username/password?<http://groups.google.com/group/cake-php/t/3da4fca944c7db18> > > > Wendall <[email protected]> Dec 09 06:58AM -0800 > > > Thanks, I was able to get Auth working as you'd described. How can I > > implement an expiration date? I have a db field called start_date, > > and want to 'expire' the passcodes 30 days after they're created. I > > have a feeling that this logic should go in the Model, but with the > > Auth component working in the mix I'm not sure how to code it. Put a > > login method in the model that tests the age of the passcode? How can > > I set this up while still working with the Auth component? > > > thanks again for any help. > > > Store only month and > > date<http://groups.google.com/group/cake-php/t/61fe2e191bd96e97> > > > Arnold Roa <[email protected]> Dec 09 09:11AM -0500 > > > Hi, im building a small test application to test cake2.0, on it im > > needing > > to save only month and year, i dont need the year. After read a while > > on > > internet i figure that is better to create a DATE field on DB and just > > ignore the year, but there is a problem with the helper, i create the > > input > > like this: > > > echo $this->Form->input('anniversary', array( > > 'type' => 'date', > > 'dateFormat' => 'DM' > > ); > > And of course that returns me an array without year, the problem is > > that > > the data is not save on DB and the array just disapear before the > > beforeValidation method, what i can do? > > > Model Test Case SQL > > Error<http://groups.google.com/group/cake-php/t/21f6c22bd9a39629> > > > flosky <[email protected]> Dec 09 06:05AM -0800 > > > Thanks, I changed that in my setup. > > > Update field in associated > > model???<http://groups.google.com/group/cake-php/t/7ec7bcbe47a72a62> > > > flosky <[email protected]> Dec 09 05:53AM -0800 > > > Hi everyone. > > > I'm having trouble with what should be an easy task. > > First up I'm using Cake 2.0.2. > > I have a User and Setting table with User hasOne Setting association. > > Now I want to update fields of the Setting table, 'prefered_language' > > for example. > > This does either not work at all, or creates a new row and doesnt > > update. > > What I would expect to work is the following: > > $data = array('Setting' => array('user_id' => $user_id, > > 'prefered_language' => $lang)); > > $this->save($data); > > But this creates a new row!! > > I can of course (but i dont want to) read the id first and include > > that into the $data array. > > > I have also tried saveAssociated via the User model (which doesnt work > > at all). > > > Since that should be a common task, how have some of you guys > > implemented this?? > > > Thanks > > -flosky > > > meioupload sql > > error<http://groups.google.com/group/cake-php/t/cb60620d3af3e1ca> > > > Paulo H3nrique Alves <[email protected]> Dec 08 04:16PM > > -0800 > > > I have the same error in CakePHP 2.0.3 > > > Elizabeth Pardede <[email protected]> Dec 09 05:45PM +0700 > > > is it in configuration??? > > > On Fri, Dec 9, 2011 at 7:16 AM, Paulo H3nrique Alves < > > > -- > > Elizabeth V. Pardede > > > Can a plugin component auto-load a > > helper<http://groups.google.com/group/cake-php/t/5ba035500fc030a5> > > > euromark <[email protected]> Dec 09 01:23AM -0800 > > > you should always mention the current cakephp version > > I am assuming however that you use 1.3 (due to App::import) > > > yes, you can. quite easily as a matter of fact. > > inside your component, all you have to do: > > > $this->controller->helpers[] = 'MyPluginName.MyHelperName'; > > or > > $controller->helpers[] = 'MyPluginName.MyHelperName'; > > (depending on where you are) > > > dont pass the helpers in this set. bad idea :) > > > Toby G <[email protected]> Dec 09 02:52AM -0800 > > > Thanks for the reply, & yes, sorry, it is v1.3. > > > This is what I'd done... > > > $this->controller->helpers['Facebook.Facebook'] = array( > > #'config' => $this->config, > > ); > > > ... but I am getting an error in my layout where I include... > > > $this->Facebook->init(); > > > The error is "Undefined property: View::$Facebook". > > > Any ideas why this might be happening? > > > T > > > Flash in > > cakephp<http://groups.google.com/group/cake-php/t/23f88acc8f4ad2e0> > > > Praveen Pandey <[email protected]> Dec 08 09:43PM -0800 > > > how can i use flash in cakephp without using any external source code. > > please help me. > > > AD7six <[email protected]> Dec 09 02:45AM -0800 > > > On Dec 9, 6:43 am, Praveen Pandey <[email protected]> > > wrote: > > > how can i use flash in cakephp without using any external source > > code. > > > please help me. > > > The same way you'd use flash in php. > > > AD > > > Model: Query distinct values from a table then save those values to > > another table <http://groups.google.com/group/cake-php/t/fedaa11bf47950dc> > > > Typezero <[email protected]> Dec 08 10:31PM -0800 > > > Hi guys, CakePHP noob here. > > > Just wanted to ask how can you query distinct values from a table then > > save it on another? > > > Say I have a table for books, certainly some of them are classified > > into a common category like fiction or history. > > > Now I created another table just to reference their distinct > > categories. I will use this table later on such that I will get the > > unique id of the distinct category to pass to a URL. > > > Hope someone can show or point me to the right direction, thanks in > > advance! =) > > > How to add a "read" button to a > > view.ctp?<http://groups.google.com/group/cake-php/t/9e68b855c9ff1bb3> > > > euromark <[email protected]> Dec 09 01:19AM -0800 > > > @daniel > > using cake2 you should distance yourself from GET requests changing > > the DB > > it always was a bad idea to do so in the first place > > use Form->postLink() instead > > > v2.0.4 Console error message on > > mkdir?<http://groups.google.com/group/cake-php/t/189b7901417e5543> > > > heohni <[email protected]> Dec 09 01:07AM -0800 > > > oh my god!! How blind i am?! > > Thanks!!! > > > Javascript Helper modification. Opinions, > > please.<http://groups.google.com/group/cake-php/t/92b8c3eea5519bf8> > > > Benjam Welker <[email protected]> Dec 08 09:35PM -0800 > > > One issue that I'm having, is that if a script is included in the > > default > > layout in the HEAD tag above the $scripts_for_layout, with the default > > 'inline' > > => true, and then again in a view (or element, or whatever) with > > 'inline' > > => false, The HtmlHelper does not recognize that the script in > > question has > > already been loaded, and proceeds to load another version of it. > > > This is troublesome, and doubly so for scripts like jQuery, where if > > it > > gets loaded again, it loses all previously loaded plugins. > > > How can I stop Cake from loading already loaded scripts that were > > loaded > > directly in the header of the layout? > > > Is this a bug? Or deliberate? > > > I've tried a few things to fix this without editing core files, but > > they > > all have their various issues. > > > 1. Setting 'inline' => false on scripts loaded in the views, the > > scripts > > that should have been loaded via the layout template (which have > > 'inline' > > => true) get moved down in the queue, setting jQuery below some of > > it's > > plugins (which only get loaded in the layout, therefore don't get > > moved > > down, and get loaded inline as expected). > > 2. Setting all scripts in the layout to 'inline' => false, seems to > > lose > > all scripts that are added in the layout template. Only loading > > scripts > > that were added in the views. Not sure why. > > 3. Setting 'once' => false on the layout scripts, then the view > > instances of the scripts get loaded as well. It seems that 'once' => > > false bypasses the storage of the script name into the > > __includedScriptsarray. > > > Any other methods for getting this to work as I'm expecting? > > > Benjam Welker <[email protected]> Dec 08 09:47PM -0800 > > > It also seems that scripts added in the default layout or through > > elements > > that are included in the default layout don't have their scripts added > > to > > the queue at all. > > > I was going to try adding all the default scripts in via an element, > > but > > they just get ignored. > > > You received this message because you are subscribed to the Google Group > > cake-php. > > You can post via email <[email protected]>. > > To unsubscribe from this group, > > send<[email protected]>an empty message. > > For more options, visit > > <http://groups.google.com/group/cake-php/topics>this group. > > > -- > > Our newest site for the community: CakePHP Video Tutorials > >http://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
