Since we provide Magento installation and Magento Migration support to our clients, we often came across this error. Before we start we should know where exactly we get this error in a Magento website. We get this error while trying to preview an email template or loading a template etc using the Transactional email options in your Magento admin panel.
STEPS TO DUPLICATE THE ISSUE:
Login to your Magento admin panel by following http://yourdomainname.com/admin
(Click to enlarge images)
Goto Transactional Emails under the system tab.
Add a new template using the Add New Template option.
Here you can see an option to Load a default Template
Select a template from the Template drop down box and then select Load Template so that the loaded template information gets loaded in the Template Information area which is just below.
Now trying to preview the template using the Preview Template option gives you the Undefined index: url error as shown in the screenshot.
ERROR:
Notice: Undefined index: url in /home/username/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php on line 253
Trace: #0 /home/username/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php(253): mageCoreErrorHandler(8, βUndefined indexβ¦β, β/home/username/β¦β, 253, Array)
#1 /home/username/public_html/lib/Varien/Filter/Template.php(134): Mage_Core_Model_Email_Template_Filter->storeDirective(Array)
#2 /home/username/public_html/app/code/core/Mage/Core/Model/Email/Template.php(283): Varien_Filter_Template->filter(Array, Array)
#3 /home/username/public_html/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php(50): Mage_Core_Model_Email_Template->getProcessedTemplate(β
Troubleshooting:
As you can see, in the Template Information section the Template Content is filled up with some codes as shown below.
ββββββββββββββββββ
<td valign=βtopβ><a href=β{{store%20url=β β}}β=ββ><img src=β{{skin%20url=β images=ββ logo_email.gifβ=ββ _area=βfrontendβ }}β=ββ alt=βMagentoβ style=βmargin-bottom: 10pxβ border=β0β³ /></a></td></tr></tbody></table><!β [ middle starts here] β>
ββββββββββββββββββ
In the above codes you can find a character %20 . What exactly is this? This is HTML URL Encoding . URL encoding converts characters into a format that can be transmitted over the Internet.
The codes in templates for certain Magento versions have HTML encoding of certain characters. In HTML URL encoding %20 stands for a blank space. To overcome this issue, replace the %20 in the Template Content code with a blank space.
In the above code for Template, you can see the store url is defined as store%20url, which is the reason for the error. Replace the %20 with a blank space as shown below:
ββββββββββββββββββ
<td valign=βtopβ><a href=β{{store url=β β}}β=ββ><img src=β{{skin url=β images=ββ logo_email.gifβ=ββ _area=βfrontendβ }}β=ββ alt=βMagentoβ style=βmargin-bottom: 10pxβ border=β0β³ /></a></td></tr></tbody></table><!β [ middle starts here] β>
ββββββββββββββββββ
Wherever you find a %20 in the template code replace it with a blank space.
You can learn more about HTML URL encoding from search engines like Google. Here is one such tutorial for HTML URL ENCODING http://www.tutorialspoint.com/html/html_url_encoding.htm .
Now use the Preview option to preview your template. You will get an output as shown below:
Bingo!! You have done it!!
For Magento installation and Magento site migration support, please do contact our 3rd party software installation team and Data Migration team respectively