Re: 3.0: a peek into CakePHP's future

2013-09-02 Thread José Lorenzo
That sounds like a cool idea, try submitting a pull request for 3.0!

On Tuesday, August 20, 2013 1:08:01 PM UTC-7, Vanja Dizdarević wrote:
>
> PROBLEM:
> After finally learning the Events system, I found myself wishing for a 
> sub-event binding & triggering scheme.
>
> If I have some callbacks bound on "Order.change" and some on 
> "Order.addProduct", I have to create and trigger two separate events and 
> results for the same functionality.
>
> IDEA:
> Dispatched event "Order.change:addProduct,updateShipment"
> triggers callbacks which are bound to events:
> - "Order.change"
> - "Order.change:addProduct"
> - "Order.change:updateShipment"
> - "Order.change:updateShipment,addProduct"
>
> Something similar to *scope* resolution in CakeLog. 
>
> I would love to have (or write) that in Cake3.0!
>

-- 
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/groups/opt_out.


Re: Warning: Fixture creation for xxx failed - Query was empty

2013-09-02 Thread Anja Liebermann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ok I have found it

So after cursing, sleeping two nights, more cursing I decided to tear
down everything and bake anew. And behold there was an error while baking.
The problem was, that I had renamed one of my tables, while setting up
the db structure, but forgot to change the corresponding key in a
related table. No wonder no fixture was found.

So now the Test is running. :)

Anja


Am 01.09.2013 20:57, schrieb Anja Liebermann:
> Hi folks!
> 
> 
> I start a new app on my local Linux machine (Linux THOR 3.8.0-29-generic
> #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64 x86_64
> GNU/Linux) Cake Version 2.3.9
> and want to give test driven development a try. I have set up my test
> database and use my root access for testing. I have baked everything via
> console and want now to start.
> 
> I created my first method in my first model and want to run the test for
> it. And even when I reduce me test method to:
> $result = 2;
> $expected = 2;
> $this->assertEquals($expected, $result);
> I get a huge load of errors.
> 
> What I can make of it that somehow it isn't able to fill my mysql table
> with the baked fixture:
> "Warning: Fixture creation for "_cycles" failed "SQLSTATE[42000]: Syntax
> error or access violation: 1065 Query was empty"
> 
> 
> Here comes the complete output, at the bottom are my settings and versions.
> 
> Has anybody an idea where to start fixing this?
> 
> 
> Thanks in advance!
> 
> Anja
> 
> 
> Running  CycleTest
> Warning: Fixture creation for "_cycles" failed "SQLSTATE[42000]: Syntax
> error or access violation: 1065 Query was empty" in
> /var/www/lunaneu/lib/Cake/TestSuite/Fixture/CakeTestFixture.php on line 235
> 
> Call Stack:
> 0.0006 249448   1. {main}() /var/www/lunaneu/luna/webroot/test.php:0
> 0.05501995720   2. CakeTestSuiteDispatcher::run()
> /var/www/lunaneu/luna/webroot/test.php:100
> 0.05501996072   3. CakeTestSuiteDispatcher->dispatch()
> /var/www/lunaneu/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php:117
> 0.06932853992   4. CakeTestSuiteDispatcher->_runTestCase()
> /var/www/lunaneu/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php:100
> 0.07343071856   5. CakeTestSuiteCommand->run($argv = array (0 =>
> '--filter', 1 => FALSE, 2 => '--output', 3 => 'html', 4 => '--fixture',
> 5 => NULL), $exit = ???)
> /var/www/lunaneu/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php:247
> 0.11784236416   6. CakeTestRunner->doRun($suite = class
> PHPUnit_Framework_TestSuite { protected $backupGlobals = NULL; protected
> $backupStaticAttributes = NULL; protected $name = 'CycleTest'; protected
> $groups = array ('__nogroup__' => array (...)); protected $tests = array
> (0 => class CycleTest { ... }); protected $numTests = -1; protected
> $testCase = TRUE }, $arguments = array ('listGroups' => FALSE, 'loader'
> => class CakeTestLoader {  }, 'useDefaultConfiguration' => TRUE,
> 'filter' => FALSE, 'printer' => class CakeHtmlReporter { protected
> $_headerSent = TRUE; public $params = array (...); protected
> $_characterSet = 'utf-8'; protected $column = 0; protected $maxColumn =
> NULL; protected $lastTestFailed = FALSE; protected $numAssertions = 0;
> protected $numTests = -1; protected $numTestsRun = 0; protected
> $numTestsWidth = NULL; protected $colors = FALSE; protected $debug =
> FALSE; protected $verbose = FALSE; protected $autoFlush = FALSE;
> protected $out = NULL; protected $outTarget = NULL; protected
> $printsHTML = FALSE }, 'fixtureManager' => NULL, 'testSuffixes' => array
> (0 => 'Test.php', 1 => '.phpt')))
> /var/www/lunaneu/lib/Cake/TestSuite/CakeTestSuiteCommand.php:97
> 0.14725655080   7. PHPUnit_TextUI_TestRunner->doRun($suite =
> class PHPUnit_Framework_TestSuite { protected $backupGlobals = NULL;
> protected $backupStaticAttributes = NULL; protected $name = 'CycleTest';
> protected $groups = array ('__nogroup__' => array (...)); protected
> $tests = array (0 => class CycleTest { ... }); protected $numTests = -1;
> protected $testCase = TRUE }, $arguments = array ('listGroups' => FALSE,
> 'loader' => class CakeTestLoader {  }, 'useDefaultConfiguration' =>
> TRUE, 'filter' => FALSE, 'printer' => class CakeHtmlReporter { protected
> $_headerSent = TRUE; public $params = array (...); protected
> $_characterSet = 'utf-8'; protected $column = 0; protected $maxColumn =
> NULL; protected $lastTestFailed = FALSE; protected $numAssertions = 0;
> protected $numTests = -1; protected $numTestsRun = 0; protected
> $numTestsWidth = NULL; protected $colors = FALSE; protected $debug =
> FALSE; protected $verbose = FALSE; protected $autoFlush = FALSE;
> protected $out = NULL; protected $outTarget = NULL; protected
> $printsHTML = FALSE }, 'fixtureManager' => NULL, 'testSuffixes' => array
> (0 => 'Test.php', 1 => '.phpt')))
> /var/www/lunaneu/lib/Cake/TestSuite/CakeTestRunner.php:63
> 0.14965798040   8. PHPUnit_Framework_TestSuite->run($result =

Re: User Defined Dashboard?

2013-09-02 Thread David Suna
If I understand the problem correctly I would restate it as:
There are dashboard items (DashboardItem) that can be displayed on a 
dashboard.  There is a relationship between user groups (Group) and a 
subset of dashboard items defining which dashboard items can be displayed 
for that group.  You want to add a relationship between the user (User) and 
the subset of dashboard items that are available to the group and allow 
them to choose which of those items will be displayed on their personal 
dashboard.

If that problem statement is correct then you would want to do something 
with a HABTM relationship between DashboardItem and Group as well as a 
HABTM relationship between DashboardItem and User with the limitation that 
only items that satisfy the constraint of being in the list of 
DashboardItems associated with a particular group are available to be 
included in the DashboardItems that can be associated with a User.

You will probably need custom code in the afterDelete and afterSave 
callbacks of the group_dashboard_items model that will update the 
user_dashboard_items model to remove or insert additional relationships.

This does not address the actual content of your DashboardItems which would 
presumably be generated on the fly from other models (as others have 
already pointed out in their responses).

-- 
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/groups/opt_out.


parseExtensions and ssl

2013-09-02 Thread David Suna
I am developing a REST API. I have it working using paresExtensions and 
mapResources.  However, if I try to access the API using ssl (https instead 
of http) the routing does not seem to work and I get an error 

Missing Method in TenantsController 
>
> *Error: * The action *30.json* is not defined in controller *
> TenantsController*
>
What do I have to do to get this to work together with SSL?

I want to enable the Security component and requireSecure for the entire 
API as well.  That seems to work but also has the same problem of the 
broken routing.

Thanks.

-- 
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/groups/opt_out.