Questions tagged [cakephp-2.5]

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

CakePHP 2.5 was released on May 12, 2014.

CakePHP 2.5 is a fully API compatible upgrade from 2.4.

You should add the generic tag in addition to this one.

Useful links:

238 questions
2
votes
3 answers

CakePHP getLastInsertId() returns zero

I am fairly new to CakePHP and having a problem getting last inserted id. My schema is as follows: CREATE TABLE IF NOT EXISTS `markets` ( `id` int(11) NOT NULL, `name` varchar(20) NOT NULL, `region_code` varchar(5) NOT NULL, `country_code`…
petermk
  • 757
  • 1
  • 6
  • 18
2
votes
1 answer

Append a class to input cakephp apart of inputDefaults CakePHP

Following http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html. I am able to give class to every form field using inputDefaults but now: Required: I want to append the class (say myClass) in some particular input to those that are…
Ashwani Goyal
  • 616
  • 4
  • 18
2
votes
1 answer

How to manually escape a boolean value for a mySQL Database insert in CakePHP?

i'm having the following code: /** @var DboSource $db */ $db = $this->getDataSource(); var_dump($db->value($open, 'boolean')); die; $this->query( 'INSERT INTO foo(`client_id`, `open`, `modified`, `created`) VALUES(:clientId, :open,…
Johannes N.
  • 2,364
  • 3
  • 28
  • 45
2
votes
1 answer

CakePHP: Saving HABTM data MySQL error

I'm trying to build a form in a view that saves data to 3 different tables that all have a many to many relations in my MySQL database, and hasAndBelongsToMany relations in the CakePHP models. However I try to do this though, it doesn't work, it…
2
votes
1 answer

Using CakeDC's search plugin to search data with multi-select field

I am trying to implement a search with CakeDC's Search plugin. In this search I have a field which has 'multiple' => 'checkbox' is set. This field allows user to select multiple cities so that they can filter results according to city/cities. What I…
Sagar Guhe
  • 1,041
  • 1
  • 11
  • 35
2
votes
3 answers

Avoid duplicates by associating to inserted records with CakePHP saveMany

I am trying to take advantage of CakePHP's saveMany feature (with associated data feature), however am creating duplicate records. I think it is because the find() query is not finding authors, as the transaction has not yet been committed to the…
user2964500
2
votes
2 answers

CORS - CakePHP does not accept AngularJS JSON-Request

I'm using CakePHP as backend and AngularJS as frontend, whereas front- & backend are in different domains so this is basically a CORS-situation. Basically I'm trying to send the contents of a form to a Cake-API (later this is meant to do…
Nikel Weis
  • 724
  • 10
  • 27
2
votes
1 answer

CakePHP internationalization not working

I've read absolutely every SO post regarding internationalization in CakePHP and nothing seems to be working for me. I'm using CakePHP 2.5.1. In config/bootstrap.php: //Default language Configure::write('Config.language', 'spa'); In…
Sandy
  • 2,572
  • 7
  • 40
  • 61
2
votes
2 answers

Cakephp 2.5 and stripping HTML

I'm working with an app that was upgraded to 2.5 from 1.1 recently. I always thought that the native cakephp behavior with text boxes and text areas was to strip html tags from input. Recently we discovered that this is not happening in this app. So…
GatorGuy023
  • 297
  • 2
  • 3
  • 11
2
votes
3 answers

Cakephp find('all') return only one row

In my application, I have two models in association Notification belongsTo Profile This is my Notificaiton modal class Notification extends AppModel { public $name = 'Notification'; public $belongsTo = array('Profile'); public function…
user3873381
  • 55
  • 11
2
votes
1 answer

CakePHP i18n - translating long text / string blocks

I have a question regarding i18n default plugin for CakePHP 2.5. I know there's a possibility to translate short strings just by placing them between __('') notation. I also know there's a possibility to translate all model-related text by adding…
OldNurse
  • 153
  • 1
  • 1
  • 8
2
votes
1 answer

CakePHP hasOne association returns array of empty fields for non-existant record

Have User and UserProfile models. User model has hasOne association with UserProfile. UserProfile mysql table is empty. When I do $this->User->find('all', array('contain' => array('UserProfile'))) instead of an empty UserProfile array, as you would…
2
votes
1 answer

cakephp form input autoFocus

I am using cakephp form helper and I want to set the input attribute autoFocus. The best I can get is autoFocus="autoFocus" which is not valid. I need to set it to just autoFocus. My code is: echo…
Keith Power
  • 13,891
  • 22
  • 66
  • 135
1
vote
1 answer

Missing Database Table Error: Database table supports for model Support was not found

I'm building a controller for a legacy CakePHP2.5 application, the controller loads an existing model then query data from the table for that model, when call the controller I keep getting the error message below Missing Database Table Error:…
iamdeed
  • 354
  • 4
  • 19
1
vote
0 answers

How to get list of failed invoices of a customer in STRIPE API?

I am working in cakephp framework and have integrated stripe api for billing and payments. Now i need to get a list of failed invoices of a customer to retry those invoices payment. I have checked Stripe API documentation but could not find a…
Mann Verma
  • 111
  • 8
1
2
3
15 16