12 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
47
views
Date field not saving on edit
My CakePHP 5 app uses a MySQL table called Documents. Each record in Documents has a 'title' and a 'dateadded' field. 'title' is TEXT type and 'dateadded' is DATE. The user can add and edit document ...
1
vote
1
answer
57
views
How avoid overwriting files in CakePHP?
I'm using CakePHP 5 and have a file upload field. This calls a function called upload in my UploadsController:
public function upload() {
$data = $this->request->getData();
$...
0
votes
0
answers
29
views
CakePHP doing incorrect date conversion
I'm building an app in CakePHP 5, and at one point it has to store and then display dates.
The date is added by the user using a standard form date control:
$this->Form->date('published');
and ...
1
vote
1
answer
31
views
Admin routes giving MissingControllerException in CakePHP
I'm building a site in CakePHP 5; I've made the main part of the site but now I'm building the admin area and getting an error.
I've set up my routes with an admin prefix, like this:
$routes->...
0
votes
1
answer
78
views
How can I find an item by id?
I'm working on a site with CakePHP 5.0. It has 2 tables: news and pages. I baked everything on the command line, and I've been able to get the pages side working ok, but I'm stumped on how to ...
0
votes
0
answers
28
views
CakePHP Bake Error - Association alias is already set
I've just created a new site using CakePHP 5 for the first time (I've used CakePHP 2-4 before). I'm baking the models from my database, but one of them is failing.
My database tables are as follows (...
0
votes
1
answer
53
views
CakePHP 5 Middleware: Authorization check error when using custom middleware
I'm building a web application in CakePHP 5 using the Authentication and Authorization plugins.
My users can be members of multiple clubs through a many-to-many relationship (using a join table). The ...
0
votes
1
answer
38
views
Cake\ORM\Marshaller::_mergeAssociation(): Argument #1 ($original) must be of type Cake\Datasource\EntityInterface|array|null, int given
Full error:
error: [TypeError] Cake\ORM\Marshaller::_mergeAssociation(): Argument #1 ($original) must be of type Cake\Datasource\EntityInterface|array|null,
int given, called in /var/www/vhosts/dpg3....
0
votes
0
answers
11
views
CakePHP Bake: extend a template extended by a plugin into the app
I created a plugin that, among other things, extends some bake templates that are generally valid and I prefer for several of my apps.
With
Configure::write('Bake.theme', 'MyPlugin');
up to this ...
0
votes
0
answers
35
views
Using `StringTemplateTrait` to build templates
I have a helper that defines the time template like this:
protected array $_defaultConfig = [
'templates' => [
` 'time' => '<time{{attrs}}><i class="far fa-clock fa-sm ...
-1
votes
1
answer
24k
views
Datasource class could not be found
i googled this error in many ways but only could find irrelevant messages
i am migrating a cakephp 4.2 PHP application to cakephp 5 and only the 'default' database is usable
in my app_local.php i have ...
0
votes
1
answer
30
views
`save()` with associated `hasMany` record fails composite UNIQUE index on "Duplicate entry"
What I have
ConfigurationsTable hasMany ValuesTable
In return,
ValuesTable belongsTo ConfigurationsTable
ValuesTable belongsTo ParametersTable
Each value can belong to a unique combination of a ...