I've added a new field in the database but when I retrieve the information regarding that model the new added field does not appear. I've deleted my cache (app/tmp/cache) but this doesn't seems to work.
Putting this line Configure::write('Cache.disable', true); in bootstrap.php make that field magically appear, but disabling the cache isn't something that I want to do, so I've deleted the line and the field is gone.
Does somebody have any idea what am I doing wrong?
Thanks
go to app/Config/core.php and change Configure::write('debug',2);
then run your code
Related
I'm trying to customise the webform email template for a specific webform following the steps in THEMING.txt, but those changes aren't being reflected in the form's default email template. I may have made a mistake in multiple places so I'm going to walk through my steps and hopefully someone will be able to spot what I did wrong :)
1) I copied the webform-mail.tpl.php template from /sites/all/modules/webform/templates directory over into the /themes/mytheme/ directory. Is that the correct place to drop it?
2) To test it, I simply changed some of the text. So I just changed 'Submitted on %date' to 'Entered on %date'.
3) I then renamed the page to webform-mail-1226.tpl.php, where 1226 is the number I see in the url when I go to edit the webform.
4) Then I tried to clear the cache, but I think this is the step I did wrong. The THEMING.txt file says to visit admin/settings/performance, but that path doesn't seem to work/exist for me. What I tried instead was admin/config/development/performance/ and then cleared the cache with the options here. Am I supposed to go somewhere else to clear a different cache?
5) I then went to the emails section corresponding to this form, and when I either go to an existing email or create a new one, the default email template does not reflect the changes I tried to implement.
Does anyone have any ideas why this isn't working? Thanks for your time and help :)
Here is checklist you need to verify:
1) Your Step 1 is okay nothing to worry.
2) If it is reflecting the change then it means default webform email template file is working fine.
3)* Here you need to verify node-id you used in filename. www.yoursite.com/node/xxx/webform, xxx = 1226 in the filename.
4) The Drupal 7 - Clear cache correct URL is admin/config/development/performance.
5)* Here you need to check in webform email setting you have to select "Default template".
Try selecting "Default template" the clear Drupal cache and then test.
Helpful link.
I have 50 fields in a Content Type, when i hit save after dragging / reordering some fields, Drupal crashes and didnt save the data. No Error in Log as well.
I have tried changing the max_post_size and Memory_limit but nothing happens.
Thanks in advance.
max_input_vars - that's the answer.
This should be in your php.ini file.
I think I screwed up somewhere while trying to create a django-cms plugin and now I am unable to go back. The plugin (called sbbplugin) seems to be "working" (it gets displayed) but whenever I try to publish the site I get the following error:
DatabaseError at /admin/cms/page/18/publish/
relation "cmsplugin_sbbmodel" does not exist
LINE 1: ...id", "cmsplugin_sbbmodel"."cmsplugin_ptr_id" FROM "cmsplugin...
^
I tried removing the plugin but I can not do it because the page is not published. My plugin has no models or anything. Also I'm unable to remove the plugin from the page by clicking delete. Seems like the database is broken. Since I am not experienced enough to know what information you need I would appreciate it, if you could give me further instructions on what I should do.
Update: I think the problem is that I tried to use a model (sbbmodel) which I deleted. Should I try to add the model again? If so what should I do to fix the database? Do I have to run a migration for my app? Do I even have to register the plugin as an app?
Update2: So I tried to add the model again and migrate the app but I get the following error:
CommandError: One or more models did not validate:
sbbplugin.sbbmodel: Accessor for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
sbbplugin.sbbmodel: Reverse query name for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
S.sbbmodel: Accessor for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
S.sbbmodel: Reverse query name for field 'cmsplugin_ptr' clashes with related field 'CMSPlugin.sbbmodel'. Add a related_name argument to the definition for 'cmsplugin_ptr'.
which I do not really understand because I never specified a foreign key. I assume it is because I inherit from CMSPlugin. Any help?
I finally fixed it. First I removed every file that I created for my plugin. Then I deleted every instance of my plugin that was saved in the database. Unfortunately that did not solve the problem and I was still getting the same error even after restarting the server.
What did the trick was to go into phpPgAdmin and select all tables than choose "correct". It did not tell me what exactly the issue was but afterwards everything was back to normal again. So if you somehow run into the same problem, just "correct" your database automatically.
I dont understand why I am not able to update a field on the database based on the following code:
$this->User->id = 1;
$this->User->saveField('image','img/default_pic.png');
Basically, I want to change the current image in the Db with a new one.
The code above just clears the value that is currently in the image field, but does not add anything.
As an example, this is what happens:
id username image
=============================
1 admin mypic.jpg
2 john johnPic.jpg
After the code above is executed I get the following result
id username image
=============================
1 admin
2 john johnPic.jpg
I am confused at what is actually happening
SOLVED!
I decided to go back and check on my user.php model class and realized that I had attempted to use MeioUpload before and gave up, but I never removed the var actsAs entry.
As soon as I commented it out, I am now able to upload pictures.
For anyone else that might come across this issue, beforeSave might also caused these kind of problems, according to the following blog: http://blog.phplabs.net/2011/11/cakephp-savefield-not-working.html
Thanks,
What does the sql log say is happening?
My guess is you are actually doing something like
$this->User->saveField('image', $variable)
and $variable is either misspelled or is empty.
For some reason my cakephp application is not showing any of the queries made to the database. It prints the table fine, but there are not records. What could cause this?
Check to make sure you are pulling the records correctly.
$models = $this->Model->find('all');
// or
$this->Model->recursive = 0;
$this->set('models', $this->paginate());
Then when you add them in the view, be sure you are looping through them correctly:
foreach ($models as $model) {
echo $model['Model']['field_name'];
}
UPDATE
To show the SQL statements, be sure you have the following set in core.php
Configure::write('debug', 2);
Also, in the Layout, besure you have this included someone between the <body> and </body> tags:
<?php echo $this->element('sql_dump'); ?>
I assume that you are getting an empty table with just the "Nr","Query","Error", etc. column headers?
You are getting the empty table because you have "Configure::write('debug',0);" set somewhere before you have "Configure::write('debug',2);" set. Find the first instance of it and delete it or change it to "2".
I know that you have long since fixed this problem but hopefully it helps somebody else in the future.
The CakePHP debug kit can help you. After you install it, you will notice a small (pie-chart) icon on the top right of your CakePHP pages. Clicking on that will allow you to see various useful information, and most importantly for this issue, all the SQL queries that occurred in the back-end upon the page loading.
I faced a similar problem in cakephp. I found that debug($variable) has limitation to the content size. Since you are fetching huge sized content from database, it is not able to print. Try doing print_r($variable) instead. To format it properly, you can do like this
echo "<pre>".print_r($variable)."</pre>";