I have been following the blog tutorial through Post Management - Creating and Updating Posts. Everything seems to be working, but my creates and updates are not being saved. I’ve tried with both MySQL and SQLite. I get no error message and my dropdown list for status is populated with choices, so I know that I am communicating with the database (with either MySQL or SQLite).
If I run the Blog Demo program I can create and edit posts. My Blog Tutorial code looks essentially the same as the Blog Demo code. I’ve even copied over the string2array, array2string, addTags and removeTags functions.
If I make changes in the accessRules() function in PostController.php, they have the expected result. For example:
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'users'=>array('@'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
Allows the account demo|demo to create and manage posts. However,
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
allows demo|demo to create post but not to manage posts.
However neither version of accessRules() results in any created or edited posts being saved.
Any thoughts or help would be appreciated.
So I thank you very much for that.