Questions tagged [cakephp-2.9]

This tag relates to the 2.9.x branch of the CakePHP MVC framework.

Additionaly to this tag, you should add the generic one .

35 questions
5
votes
1 answer

Missing/broken image after migration for Cake PHP

I'm maintaining to exist project which migrated from another host. I'm facing this issue where the image from app/media/tf/img/ are broken whereas from other path are working fine. Below are stack trace from error.log 2020-12-04 16:44:47 Error:…
Azlina T
  • 176
  • 2
  • 17
2
votes
1 answer

`CakeResponse` referencing undefined variables in `compact()` call triggers errors/notices

I’m updating my first CakePHP application on a web server, but pages show errors which are at the end of this post. I can’t find the file(s) which have not uploded correctly. Thanks for help. CakePHP version : 2.9 Error messages : Notice (8):…
Uultron_10
  • 21
  • 1
  • 2
2
votes
1 answer

Cakephp: MissingControllerException: Controller class AlarmsControllerController could not be found

I have a project on Cakephp 2.9.7. When I run test on my local machine I do not get any errors. But, when I try to run ./Console/cake test app Controller/AlarmsController or test any other controller in my docker image, which actually has the same…
handkock
  • 1,067
  • 2
  • 11
  • 23
1
vote
1 answer

Call other model's callback method

I'm using CakePHP 2.9. I want to call Child's afterSave in Parent's afterSave. Here are my models with their callback methods : Parent Model /* * @property Child @Child */ class Parent extends AppModel { public $hasMany = [ 'Child' =>…
Maya Nastasya
  • 197
  • 2
  • 16
1
vote
1 answer

CakePHP 2 - Two foreign keys of a table linked to the same single table primary key

How can i use cakephp 2X model hasone or other association concept here to execute the find query. In my Schinfo.php model is class Schinfo extends AppModel { public $tablePrefix = 'sko_'; public $hasOne = [ 'State' => [ …
1
vote
2 answers

File system path for images

I'm writing a custom helper that extends HtmlHelper and overriding the \HtmlHelper::image() method to calculate the image dimensions and add them as HTML attributes. What I have so far works fine for regular pictures: public function image($path,…
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
1
vote
1 answer

CakePHP 2.9.7 Model::beforeSave()

Is it possible to know what kind(INSERT,UPDATE,DELETE) of query is going to be executed beforeSave() because there is user which can update only and other that can insert only and so on
SamGX3
  • 47
  • 1
  • 1
  • 7
1
vote
2 answers

How to load Model in Cakephp directly

before testing all my models in Cakephp app using ./cake test app AllModel I have to do some manipulations. I use Cakephp 2.9.7. This function is declared in AllModelTest.php which looks the next way: class AllModelTest extends CakeTestSuite { …
handkock
  • 1,067
  • 2
  • 11
  • 23
1
vote
1 answer

Is it possible to show default layout in error pages?

I want to style my app from scratch so I've created a brand new layout and assigned it as default: class AppController extends Controller { public $components = array( 'DebugKit.Toolbar', ); public function beforeRender() { …
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
1
vote
1 answer

CakePHP: default database is working, while test doesn't

Hi after changing to Schema type of database and the CakePHP version from 2.4.4 to 2.9.7 the test database just doesn't want to work: Error: Database connection "Mysql" is missing, or could not be created. when I want to run tests: ./Console/cake…
handkock
  • 1,067
  • 2
  • 11
  • 23
1
vote
1 answer

TableAlias__ColumnAlias syntax in virtual fields not being parsed as documented

Docs state that we can name calculated fields using a syntax like Timelog__TotalHours and PHP will parse it as: [0] => Array ( [ProductsItems] => Array ( [Total] => 50 ) ) In my CakePHP/2.9.4 set up I'm trying it in…
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
0
votes
1 answer

Download dynamically generated PNG in CakePHP 2

I have a QR code PNG being dynamically generated. I can access it by going to www.example.com/events/qrgen, which causes it to be displayed in the browser correctly. Now, I would like another option that downloads the PNG file. Here is what I've…
Dave
  • 28,833
  • 23
  • 113
  • 183
0
votes
0 answers

Cake PHP 2.x - view variables not defined as expected

So we are running into a problem that is recurring several times, caught through logs. We are getting loads of undefined variable notices. When we trace where they are supposedly undefined, they are always defined in the matching controller action…
0
votes
1 answer

unable to passe page 2 by paginator on cakephp 2.9

I am currently facing a little problem. let me explain : I develop a database under cakphp 2.9 I use a custom search function, the problem is that when I click on the next page I have an error that appears (the first page is displayed without…
dsigner
  • 33
  • 8
0
votes
1 answer

Cakephp date db field upon each and every request

I'm using cakephp 2.9 and trying to record to database each user last interaction with my web app which is the 'lastactivity' datetime field on the users table. For this I figured to write the code inside AppController's beforeRender. So my code is…
Chrishow
  • 363
  • 1
  • 5
  • 13
1
2 3