Magento file changes not taking effect and flushing cache - php

I'm copying a Magento Enterprise 1.11.2.0 core file called Preview.php into the local folder with same directory structure to override this particular file because it is not functioning properly. More specifically, it is not allowing the transactional emails to be previewed. I made changes for a fix in the .php file that goes in the local folder, but Magento doesn't seem to think there are any changes. I even tried modifying the core file itself to additional garbage strings appended to the returned variable, but that didn't register either.
Now, as I understand it, I need to flush the cache, but I don't think I'm doing this properly for these changes to take effect. In the Cache Management section, I've tried "Flush Magento Cache," but I have not tried "Flush Cache Storage" because I was told not to touch that from the person who set up our installation. What are the differences? Could flushing the cache storage make the overriding preview.php kick into action?
ADD:
The directory structure is correct. As I mentioned, some files (while others take effect just fine) changes is not recognized by Magento installation for some reason.. One of our guys thinks maybe it's one of the extensions we're using that is overriding some portions, but I really don't see anything that's overriding the core app files or images in the skin folder.
For example, if I delete "logo_email.gif" in the theme folder we're using, it should fall back to the default Magento logo image. Instead, the Magento instanace thinks the file is still there and even loads it! I'm forced to create our own logo file called logo_email.png and load this file in the email templates, because deleting or overwriting this file doesn't work.
I've submitted a support ticket to Magento.. I will update if I make any progress.

I believe the culprit was the Magento compilation feature, under System -> Tools. Disabling this allows for the code changes to take effect!

Related

.tpl file not updating when changes are made

I have been given a massive PHP e-commerce website to work on that is already mostly built, but I am currently having an issue regarding .tpl files. No matter what changes I make to the files, when they are saved the server will not update them (the files are staying saved, not reverting back to previous versions). My CSS changes and changes to PHP files are working but the core code within the .tpl files just doesn't want to play. I have seen a lot of places on the internet regarding these files in relation to something called smarty but I have not seen anything relating to that in this project and have just hit a brick wall.
After logging as Administrator, go to Configuration -> Performance -> Clear Cache
Click on Clear All Caches.
Once the Caches are cleared, the changes on the Template (tpl) files will be reflected.

OpenCart .twig file not showing changes

I've been trying to change the product/catalog.twig file, to remove some unnecessary buttons such as the "add to wishlist" and "compare product" options, which are just useless for the store I'm attempting to make.
On the theme editor, I've removed the two buttons from the .twig file, yet the changes aren't showing on the store. I've heard it might be an issue with caching, like it's bringing up the old site. So I deleted the cache from the storage folder, yet the problem still persists.
In OpenCart 3.0.2.0 there is button with a gear icon in admin dashboard. It open up a modal that allow you to clear cache or disable cache.
First of all, Its better to use the OC's builtin Theme Editor to make any change in any template file. In-case you want to change something directly using FTP Client or a file-manager, you must know the OpenCart Structure a little :-)
Anyway, bellow are the few things that can be helpful for anyone looking for the solution.
1) You have enabled the cashing, you can clean it as described by #DigitCart - Alternatively, you can clear all the files in following folder YOUR_STORAGE_DIRECTORY/cache/* (Don't remove the cache folder)
2) Probably you are trying to make change in a file that is modified previously by an Extension, You can find the modified files under YOUR_STORAGE_DIRECTORY/modification/* You can make a small extension and install it through Extensions > Installer to make changes in these files. OR, you can change these files directly via FTP, but its not recommended.
Sometimes, depending on the file you want to edit, you have to Rebuild The Modification Cache. Simply go to Extensions -> Modifications, and click the "Refresh" button at the top of the panel.

Magento CSS cannot be updated

I'm Trying to replace my style files with new files that have been implemented on another machine, but nothing changed
I Flushed all caches (images and CSS) , Disabled Mergeing CSS Files and run the compilation
Without knowing what files you have overridden and your current theme design this will be hard do debug, but one this I can suggest doing is to disable all caches, disable merging and disable compilation. This should help you to see if you are changing the correct files. If after this step your changes are not being made then you are changing the wrong files.
After that what you can look at doing is simply updating the file you think should be called and adding some weird css like adding a green border around everything, but obviously this is not great on a live site so you could but in place a maintenance page to all up your own ip.

Not able to edit contents in magento from backend after a installing modules

I have site build in Magento 1.7
I have installed a new shipping module Bpost through magento connect. When I installed that, it raised the error that, it is already existing plugin. After that when I accessed the site, the maintenance flag was active.
When I removed the maintenance flag and checked the site, everything seems to be working fine in the front-end. But I am not able to add or edit contents from the back-end. Click is not detecting in the existing lists of contents and when I click on add new (for cms block, page etc) the new section appears, but no action is performed while clicking save.
Why is this happening ? How can I resolve this issue ?
I recreated the site with my backup files to a new location. After that removed all the existing plugins and installed all the plugins. At that time all seems to be working fine. After that I have edited the header.phtml file and added some additional script.
The script was for getting contents and displaying it using script. After that when I run the site and went to backend everything again went to non editable mode. Now I am not able to click or edit any cms contents in the site of static blocks, products etc.
Why is this happening ? How can I resolve this issue ?
In my opinion, the problem comes from a javascript with an error that blocks the rest of the javascript. All buttons use javascript to fire events. With firebug or something similar, check which error is raised in the admin javascript and try to fix it. Using the solution that Niraj Jani gave about disabling module is a good way to check if it is really the module that blocks the javascript. If the problem is linked with prototype, it can come from the definition of blocks in php, the design template or layout...
Have you tried after claering cache?
Take Look at below link and its answer,
In Magento after installing extension Admin panel in unable to load
Delete (or move to another folder) files in /var/www/var/cache
Delete (or move to another folder) files in /tmp
From a shell, run
/var/www/shell$ php indexer.php --reindexall
You've just manually cleared your caches and re indexed your data. See if your system comes back to life.

Magento custom category widget not appearing on stage server

I followed this (first comment),
magento - category name and image in static block? to create a simple widget to display the category image and title from a static block on a CMS page. It works fine on my local MAMP version of Magento Enterprise 1.13.0.2. It's not working however on the stage / test environment Magento 1.13.1.0. (ubuntu).
It doesn't error, it's as though it's ignoring the template file (info.phtml). When I reverted to the default theme I realised I had to copy the template files to the default enterprise folder to get it to work but it did (local version). I have made sure that the template folders are in each of the themes, base, enterprise (default), MyTheme (default (which is enterprise default) & (MyTheme / MyThemeVariant)).
The only setting / configuration that appears to be different between the local and the stage is that pretty url's aren't working on the local. I have looked into the htaccess and it still isn't resolved. On both versions the native Category link Widget isn't working but i'm not sure if that is relevant.
I have disabled any extensions turned the cache off and cleared the index. Still nothing.
I have been looking for the answer, retracing my steps, altering and changing back any setting(s) I think may be relevant for 3 days now so i'm well stuck. Anything anyone can offer to try I will give it a go.
So in Magento Enterprise there is also a full page cache that you can access via the Magento Admin here : System->Configuration->System->advanced->External full page cache settings.
On the page System->Cache management, as well as disabling all the caches you should flush the Magento Cache and the Cache Storage.
You might have a 'cache' called Redis or APC, but I don't think that affects .phtml output. and if you can access the Widget in the back end I don;t think those items are the problem.
Your webserver might have a full page cache such as Varnish but I don't know how to use it or turn it on or off.
Theoretically your webserver headers might be saying 'this page doesn't update so internet providers can store local copies in their caches' - but I would be astonished if that was the case (inspect your header and inspect the Cache-control Expires and Last-modifed headers if you want to eliminate this possibility).
Your browser might have it's own little cache (which you can clear from your browser settings).
If it isn't a cache problem, in my experience .phtml files get skipped if they have PHP errors in them but you have it working on your local dev server. Could it be a file permission issue? Could it be a setting in the widget on your server that is not handled by your widgets .phtml? As alast resort, try changing your widget .phtml to a really simple file like <?php echo('test PHP output'); ?> and see if that renders - try putting the widget on different pages (ie new pages that won't be cached anywhere) and see if that get's everything through.
Could you have a namespace conflict with another module? Eg an XML file is changing your widget block XML name that sets the .phtml template? Does your widget.xml file declare <supported_blocks>...</supported_blocks> which might be excluding the block into which you are trying to render the widget?
What else? You mentioned this widget displays category information: Are you referring to a category that exists on your staging server? It will probably have a different category ID than your dev server and / or check the category is visible in the website and store.
Okay, I think I am out of ideas now.
The problem was that "Block" php file's first letter was lowercase. I changed it from info.php to Info.php and now everything works as expected.
This has been the single most frustrating investigation yet into Magento. The only thing I hope is that it saves someone a whole load of pain.

Categories