Where is Magento's data for custom modules in admin panel contained? - magento

I made a module for admin panel magento and added fields.
All fields (text, textarea, etc) and their values are showing correctly. When I save it, they are also getting saved.
I cleared session, cookies and browser history and all. The values are still there. That means values getting saved in database.
But since I didn't provide any database name, I don't know where those values are persisted.
Can anyone tell me where the data is persisted?

Magento takes care of persisting the admin configuration automatically. The field values are stored in the core_config_data table.

Related

add custom image field for custom options in magento

I am working on magento 1.9 version.I want to add a custom image field in drop down of custom options.
I added a text field using following guide
http://magento.ikantam.com/qa/how-add-custom-attributes-custom-options
which is working fine.but when I add a file field then it shows in admin but not save image field value in database.
please help me to solve this.
Neeraj,
Did you specifically click "flush cache storage" By following this guide and adding new tables directly to the database, Magento already has this record in cache. By flushing cache storage, you will allow magento to recognize the new structure and be able to save the record. I have accidentally forgotten to do this quite a few times and you end up with the inability to save a record even though your structure is there.

Magento session cookie, form keys not working correctly. (magento 1.8.1)

For some reason, after debugging i've noticed that form_keys are valid only after i clear the cache by doing a manual rm -rf * in the var folder, clearing my browser cache and retrying the site.
I have made no changes to the core code, I've diffed it to the original 1.8.1 installation, and they are exactly the same.
The original problem I had was that customers couldn't login because I had been using a customer/persistent/login.phtml file from the 1.7.0.2 version, and had to change it to add the form_key as a hidden input element using the method shown in all other posts about the new addition of form keys in magento 1.8.1.
I had captcha enabled, and for some reason when I went to the customer login, captcha isn't displayed.
Randomly, I don't know what I did, the page refreshed, and the captcha displayed and I was able to login to the dashboard and it worked. Then I logged out, and the same problem happened, the customer logs in with the correct username/password, but is redirected to the same customer login page.
I have debugged the loginPostAction in AccountController.php from app/code/core/mage/customer/controllers, and it appears that when the form key is valid, after refreshing cache, clearing cache, in mage and the browser, it reaches if( getIsJustConfirmed == true){ go to __welcomedashboard(..) } however getIsJustConfirmed returns null or false.
I did a check to see where getIsJustConfirmed is set, and it appears in setCustomer of the Session.php inside app/code/core/mage/customer/Session.php:
public function setCustomer(Mage_Customer_Model_Customer $customer)
{
// check if customer is not confirmed
if ($customer->isConfirmationRequired()) {
if ($customer->getConfirmation()) {
return $this->_logout();
}
}
$this->_customer = $customer;
$this->setId($customer->getId());
// save customer as confirmed, if it is not
if ((!$customer->isConfirmationRequired()) && $customer->getConfirmation()) {
$customer->setConfirmation(null)->save();
$customer->setIsJustConfirmed(true);
}
return $this;
}
the first part of !$customer->isConfirmationRequired() always returns true, however $customer-->getConfirmation() returns null, so it doesn't setIsJustConfirmed(true).
As you've noticed, Magento 1.8 adds form keys to a whole lot of forms. The form key in the hidden input field needs to match the form key in your user's session. This plays havoc with any form of caching, as the form key stored in the block or full page cache is unlikely to match the user's session key.
Firstly, I'll assume you've already compared the templates you've copied into a custom theme against the base/default versions and added form keys wherever they're missing.
Then, the next suggestion is to turn all caching in Magento off (and any full page caches such as Varnish) and see if that resolves the problem. This will confirm that you're caching form keys somewhere and this is the cause of your problem.
Next, use a tool like Fabrizio's Advanced Template Hints to see if any of the templates containing a form key are being cached, either explicitly or implicitly via a parent block. If so, this is the cause of your problem, and you'll need to investigate what is causing these blocks to be cached. A stock Magento system won't cache these blocks, but a 3rd party extension might be causing it.
Finally, once the block cache is resolved, you'll need to think about full pace caching (if used). There's no easy answers here, you'll need to either not cache the affected pages in a FPC, or find a way to put the correct form key into the page after it's served.
Step-by-step, I was having the same issue. I started logging the session key output by Mage::log(Mage::getSingleton('core/session')->getFormKey()); on each page load.
Until attempting to login as a customer, the session remained consistent.
However, after attempting to log-in, I determined that the session was getting invalidated on each page load (i.e. the aforementioned logging method echoed a different form key on each page load).
This led me to the cookie. I noticed that after attempting to log in as a customer, there were two frontend cookies stored by the browser: one with .my_domain.com and another with just my_domain.com, thereby causing the invalidation.
Setting the cookie Domain under System -> Configuration -> General -> Web to my_domain.com addressed the duplicate cookie problem and the forms behaved as expected.

Magento - I deleted a website by accident

I was going to delete a store view for a particular language in Magento.
I deleted the website view by accident. Luckily I made a back-up just moments before. The tables 'core_config_data' and 'core_websites' have been restored and it seems the website is working properly.
However I need to be 100% sure that no other data is missing. Magento does state:
'Removing a website does not lead to the removal of the information associated with (eg categories, products, etc.), but the removal can not be undone. We recommend that you back up your database before performing the removal.'
I need to know in which tables data is removed when you deleted a website view?
The safest is to restore your full database. If you delete a website all the stores associated to it are deleted and so all all the product values set for those specific store views.
For example if you had a product named 'Something' but on a store view from the website you delete it had the name 'Something else' then you will lose this. If you restored only the store views the name of that product on the specific store view will be 'Something'.

Embed Custom Text Fields in OnePAgeCheckOut Magento

I need to add text fields in Magento OnepageCheckout form. It is not possible to add text fields via admin panel. It is a module installed for one page check out and has its fixed fields so only possible via coding.
I have made changes in
app/design/frontend/base/default/template/onpagecheckout/onepage/billing.phtml which is the exact page I am suppose to make changes in but form displays as previous. I did flush the cache every time but not getting whats going wrong.

Magento secret key admin login

I turned off the option to use the secret key in the Magento (1.7) admin URLs yesterday. Today when I try to log in it tries to use the secret key, but fails because I disabled it. The effect is that I can't get into the admin now because every login request fails. Can anyone give me the location of the setting in the database or give me another way out of the hole I dug for myself?
In case you don't have access to Magento admin area, but you like to turn on the option to use the secret key in Magento you can try to execute SQL query over the DB of your Magento installation or to use web interface ( e.g. phpmyadmin ).
Basically you have to find a record where column path = admin/security/use_form_key in table core_config_data and to set it's value to 1
In case you use phpmyadmin or similar software, just navigate to the table core_config_data find the desired record and change the value. It also will work if you delete the record, because if the record doesn't exist Magento will fetch the value of the xml configuration files and the value there is set to 1
Also keep in mind, that some Magento installation use DB table prefixes and the table core_config_data may have different name e.g. prefix_core_config_data

Resources