31,602 questions
2
votes
0
answers
81
views
Error in react-webview: error loading page. Domain: undefined. Error code: 3. Description: SSL error: The certificate authority is not trusted
I can't open a website within a webview in React Native. I always get the following message.
Note: the site has normal SSL, but the SSL error keeps appearing:
error loading page. Domain: undefined. ...
0
votes
1
answer
40
views
Apache .htaccess should redirect only if substring NOT found in URI
Completely stumped fiddling with .htaccess in a CakePHP app. Checked a few SO posts and Perplexity.ai LLM. But still getting erroneous results. Trying to do a simple full host redirect, but skip the ...
0
votes
0
answers
62
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
0
answers
61
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
36
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
0
answers
35
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
90
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
1
answer
96
views
Retrieving values from 2 tables at the same time in CakePHP 3
I'm developing a small module on CakePHP 3 and I'm currently encountering a small problem that I can't seem to solve.
I have two tables: Events and shop_ticket.
Events table:
I store information ...
1
vote
1
answer
72
views
Api Rest in CakePHP: How to return id fields (Bigint) as string and not as INT/BIGINT?
I created a REST API in CakePHP 4.5, and all the ID fields are of type Bigint. Is there a way to force CakePHP to convert these fields to strings before returning the JSON?
There are many fields, and ...
0
votes
0
answers
49
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
56
views
Resource class Administrator does not exist while implementing modeless policy
I'm trying to implement a policy for a model-less controller. The error I keep getting when I access /administrators/import
Resource class Administrator does not exist.
InvalidArgumentException
Here ...
0
votes
0
answers
86
views
Can you get CakePHP 4 to return JSON error responses automatically when writing an API?
CakePHP 4.x
We have an application which consists of a frontend web app (used by customers through a browser) and an API for some backend operations which is integrated with our other systems.
The ...
0
votes
1
answer
70
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
41
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
1
answer
89
views
File validation in CakePHP 4
Basically trying to do this https://discourse.cakephp.org/t/validate-uploaded-file-size-through-model/6755/5 in a CakePHP 4.5.9 application.
I have a Model called Whitepapers and with I'm trying to ...
0
votes
0
answers
48
views
Trying to understand PHP Garbage Collection [duplicate]
Forgive my ignorance but I've not played around with PHP's garbage collection before. Specifically, I'm running a CakePHP 5.x Command Script and running into memory exhausted issues.
As a test to see ...
-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
32
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 ...
1
vote
0
answers
51
views
having problems since recreating my database
I have a controller on my Api folder named CrudsController and I have this function. what I don't understand is this is properly working before I had issues with my database that I had to recreate. ...
1
vote
1
answer
63
views
CakePHP connect to Google SQL Proxy Container
For starters, I have a docker container running for "cloud-sql-connectors/cloud-sql-proxy:2.14.3" and it has credentials and appears to have started and is running fine.
2025-01-29 12:31:44 ...
1
vote
1
answer
46
views
Where do you store configuration profiles for CakePHP 4 Mailer?
I'm writing an app in CakePHP 4.5 which sends emails.
I'm trying to avoid writing this all over my code
$mailer = new Mailer('default');
$mailer->setEmailFormat('both')
->setFrom(['me@example....
0
votes
1
answer
139
views
CakePHP stores 2024-12-30 as 2025-12-30 in MariaDB, but 2024-12-29 works correctly
I’m working on a CakePHP application where I save dates into a MariaDB database. The absent_date field is of type DATE. However, I’ve encountered a peculiar issue:
When I save 2024-12-30, it gets ...
0
votes
0
answers
57
views
How to build a query to update a record using CakePHP 4.4 and Slim-4 and MariaDB
The back story on this request is I am using SlimFramwork 4 Skeleton. I have been running it for a couple of years now. I need to update a record in the database. I have this method
namespace App\...
0
votes
0
answers
44
views
Nested routes prefixes in CakePHP
In my routes.php I currently have this:
$routes->prefix('Api', function (RouteBuilder $routes) use ($apiCache) {
$routes->registerMiddleware('apiCache', $apiCache);
$routes-&...
0
votes
0
answers
60
views
PDO Exception Unknown column when removing column from data table
I am currently working on removing deprecated columns from my database. After dropping a specific column, I encountered the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column
'...
1
vote
1
answer
24
views
Make CakePHP querybuilder wrap a subquery in parentheses
How do I wrap a subquery in extra parentheses?
$sub = new \Cake\Database\Query();
$sub
->select('b.value')
->from(['b' => 'other_table'])
->where(['b.key' => 'fancy_cars'])
;
$...
0
votes
1
answer
83
views
Submitting Modelless Form with FormHelper in cakePHP5
I am using cakePHP5 and I'm having trouble submitting post values with FormHelper and it's a modelless form. Here is the code .
C:\xampp\htdocs\cake3app\templates\Hello\index.php
<!DOCTYPE html>
...
0
votes
1
answer
104
views
Vscode extension for cakephp import?
For instance I have the following statement,
TableRegistry::getTableLocator()->get('Users')->find()
Intelephense is showing, Undefined type 'App\Controller\Api\TableRegistry'.intelephense(P1009)
...
0
votes
0
answers
37
views
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'processing.org_dress_id' in 'on clause' in CakePHP
$emp_detail = $this->fetchTable('EmpDetails')
->find(contain: ['Processing.ProcessStage',
'Processing.OrgDress.PrimaryC',
...
0
votes
1
answer
82
views
Aliases for table fields in CakePHP4
In my DB I have a table page_content with a column which is a reserved MySQL 8 word, row.
Due to constraints mandated by my hosting system, I need to rename the column to something that isn't a ...
0
votes
1
answer
80
views
How to use `distinct()` in a query in Cakephp5?
I'm looking for the way to avoid duplicates in a query in Cakephp5.
Here is my table rubriques :
id | ... | model | ...
======================
1 | ... | CustomRubriques | ...
2 | ... | ...
0
votes
1
answer
50
views
How to select mulitple options in multiple select select menu in cakephp
This is my code for the multiple select menu in my cakephp application:
<td><?= $this->Form->select('clothCutting['.$color.'][mtr_str]', ['23'=>'23', '67'=>'67', '24'=>'24'], ['...
0
votes
1
answer
120
views
CakePHP 5 with latest CakeDC Users plugin
Went through all the setup and installation, got all my apis and connecting to google. However it's throwing and error message. So I debugged it some and at a lose or brain dead at the moment.
Traced ...
0
votes
1
answer
47
views
Unable to save data using HasOne association in Cakephp 4
I have tried to join two tables using hasOne association in my cakephp app
There are two tables users and admin. In both tables the id is primary key. i have linked the mobile field of admin to the ...
0
votes
1
answer
129
views
CakePHP 5: how to get total number of records retrieved with pagination
I'm migrating from cakephp 4 to 5.x, and in an API I need to return the pagination data.
In cakephp 4.x
$paging = $this->request->getAttribute("paging");
$paginacao = [];
foreach ($...
-1
votes
1
answer
35
views
Timestamp in database is European (16:35), but in CakePHP application is UTC (14:35)
Working on development of application, using CakePHP 5 framework.
Problem I have, is that it shows different timestamp for same record in application and in database.
To prevent that, I made changes ...
0
votes
1
answer
138
views
Paginating with sort and direction
Cakephp Version: 5.0.10
Hi,
Tickets Controller - The Process
The page is initially loaded and I initialise the limit from the database and store in a setter with:
$this->setLimit($user->...
1
vote
1
answer
123
views
Why getting this error message submitting a cakePHP file upload form data?
I added enctype="multipart/form-data" In the form with the input fields for files or images.
Please, can you help me review my codes and why I have this error message issue below on trying ...
0
votes
1
answer
181
views
CakePHP giving error 302 (due to sessions?) after migrating a website
I have to migrate CakePHP 1.3.0 website which uses PHP 5.6 version, in this case from CPanel to Plesk, I tried using Plesk Migrator extension, for those who don't know it, it connects to source server ...
1
vote
0
answers
52
views
CakePHP 4 JSON response gives phpstan error
According to the CakePHP 4 docs
// If you want a json response
$response = $response->withType('application/json')
->withStringBody(json_encode(['Foo' => 'bar']));
If you run phpstan on ...
-1
votes
1
answer
85
views
Getting " The request to `/users/login` did not apply any authorization checks." while using Authorization in cakePHP
I am learning to implement authorization cakephp 5 using this documentation https://book.cakephp.org/5/en/tutorials-and-examples/cms/authorization.html
But i'm getting "The request to /users/...
0
votes
1
answer
54
views
Accessing data in another table without a relationship in a query
CakePHP Version 4.4.11
Hi,
Introduction
In text I would like to do the following:
visit the lead archives table and select records with the account_id.
visit the contacts table and select records ...
0
votes
0
answers
54
views
Calling component in a Cell using CakePHP 4
How is a component called in a cell? Or is that still not advisable? Ex. CakePHP 3 Component in a Cell
I have the following code in my cell:
$coordinatorDiscussions->formatResults(function (\Cake\...
0
votes
0
answers
60
views
Intermittent TABLE ALREADY EXISTS database error
In CakePHP 4.3.3 with SQLite I use a temporary table which I refresh by deleting and re-creating. Occasionally from the CREATE statement I get an error that the table already exists, despite that my ...
0
votes
0
answers
31
views
how to automatically load a custom view in a plugin in cakephp?
Here I developed a nano system to publish thoughts in a diary, very simple, but functional for the need. The content is in a Json structure and there would be a need to change the aesthetics of the ...
0
votes
0
answers
44
views
beforeSave is not firing when saving entity
im trying to use Cakephp version 3.10 to fire a beforeSave event but it's not doing anything.
This is the only Controller / Table that dont wa
Controller
public function edit($id = null)
{
$...
1
vote
0
answers
38
views
Unable to use both route options and a nested resource callback in CakePHP 5.x
I'm trying to use nested restful routing by CakePHP 5, but it seems impossible to use both route options as an array, and nested resource definition as a callback. The following example does not work ...
0
votes
0
answers
104
views
Cakephp 5 Form Helper Displaying validation messages before sending the form
I'm doing the cakephp 5 cms tutorial and I want to use Boostrap 5 form validation.
But I see that the Form Helper does not render the div with error messages for the field’s required and notBlank ...
0
votes
0
answers
152
views
Adding authentication component to versionned API
URL being accessed: /api/v1/requests - using Cake - Setup routing to support versioned API controllers? as inspiration
The goal is to load my own custom authentication, however, it's partially loading ...
0
votes
0
answers
47
views
CakePHP5 - How can I migrate findAuth from CakePHP3
I'm about to migrate my old CakePHP3 App to 5.
It is quite difficult.
I try to entend the Auth Identity which is actually limited tu users table field with associated data.
In 3 i use FindAuth, but it ...