cancel
Showing results for 
Search instead for 
Did you mean: 

SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

SOLVED

SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file app/Mage.php
checking file app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php
checking file app/code/core/Mage/Adminhtml/Controller/Action.php
checking file app/code/core/Mage/Adminhtml/controllers/AjaxController.php
checking file app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php
checking file app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php
checking file app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php
checking file app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php
checking file app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php
checking file app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php
checking file app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php
checking file app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php
checking file app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php
checking file app/code/core/Mage/Adminhtml/controllers/JsonController.php
checking file app/code/core/Mage/Adminhtml/controllers/NotificationController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php
checking file app/code/core/Mage/Adminhtml/controllers/Report/TagController.php
checking file app/code/core/Mage/Adminhtml/controllers/ReportController.php
checking file app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php
checking file app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php
checking file app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php
checking file app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php
checking file app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php
checking file app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php
checking file app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php
checking file app/code/core/Mage/Adminhtml/controllers/TagController.php
checking file app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php
checking file app/code/core/Mage/Adminhtml/controllers/TaxController.php
checking file app/code/core/Mage/Api2/controllers/Adminhtml/Api2/AttributeController.php
checking file app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php
checking file app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php
checking file app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php
checking file app/code/core/Mage/Checkout/controllers/MultishippingController.php
checking file app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php
checking file app/code/core/Mage/ImportExport/Model/Abstract.php
checking file app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
checking file app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php
checking file app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php
checking file app/code/core/Mage/Rss/controllers/CatalogController.php
checking file app/code/core/Mage/Rss/controllers/OrderController.php
checking file app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php
checking file app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php
checking file app/design/frontend/base/default/template/checkout/cart.phtml
checking file app/design/frontend/base/default/template/checkout/cart/noItems.phtml
checking file app/design/frontend/base/default/template/checkout/onepage/failure.phtml
checking file app/design/frontend/base/default/template/rss/order/details.phtml
checking file app/design/frontend/base/default/template/wishlist/email/rss.phtml
checking file app/design/frontend/default/modern/template/checkout/cart.phtml
checking file app/design/frontend/rwd/default/template/checkout/cart.phtml
Hunk #1 FAILED at 115.
1 out of 1 hunk FAILED
checking file downloader/Maged/.htaccess
checking file downloader/Maged/Controller.php
checking file downloader/Maged/Model/Session.php
checking file downloader/lib/.htaccess
checking file downloader/template/connect/packages.phtml
checking file downloader/template/connect/packages_prepare.phtml
checking file downloader/template/login.phtml
checking file downloader/template/settings.phtml
checking file errors/processor.php

 I beleive cart.phtml file has been modified.  Can anyone tell me where I can locate the 1.9.1 repository so that I may do a diff on cart.phtml?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

https://www.magentocommerce.com/download

 

Look for "Release Archive" tab, select version number, choose archive type from dropdown and then hit download button.

View solution in original post

6 REPLIES 6

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

https://www.magentocommerce.com/download

 

Look for "Release Archive" tab, select version number, choose archive type from dropdown and then hit download button.

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

The file has been modified.  Any gurus out there have a simple solution for this, as I'd like to be able to apply the patch.  My 1st thought was to replace the cart.phtml with the original, then patch, then attempt to apply the changes that have been made if necessary.  Unfortunately I don't have the previous developers notes as to why these changes were made Smiley Sad

 

[root@ip-10-0-0-100 checkout]# diff original.cart.phtml modified.cart.phtml
38c38
<         <?php if(!$this->hasError()): ?>
---
>         <?php /* if(!$this->hasError()): ?>
43c43
<             <?php endif; ?>
---
>         <?php endif; ?>
46c46,53
<         <?php endif; ?>
---
>         <?php endif; */ ?>
>         <ul class="checkout-types top">
>          <?php echo $this->getChildHtml('form_before') ?>
>         <li><form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
>               <?php echo $this->getBlockHtml('formkey'); ?>
>               <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Empty Cart'); ?>" class="bu                  tton2 btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Clear All'); ?></span></span></button>
>         </form></li>
>         </ul>
71c78
<                     <th class="a-center cart-price-head" colspan="<?php echo $mergedCells; ?>">
---
>                    <!-- <th class="a-center cart-price-head" colspan="<?php echo $mergedCells; ?>"> sai commented -->
73c80
<                             <span class="nobr"><?php echo $this->__('Price') ?></span>
---
> <!--                             <span class="nobr"><?php echo $this->__('Price') ?></span> sai commented -->
75c82
<                     </th>
---
>                     <!-- </th>  sai commented -->
109c116
<                         <button type="submit" style="visibility:hidden;" name="update_cart_action" value="update_qty" title="<?php echo $                  this->__('Update Shopping Cart'); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span>                  </button>
---
>                         <!--  <button type="submit" style="visibility:hidden;" name="update_cart_action" value="update_qty" title="<?php                   echo $this->__('Update Shopping Cart'); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span><                  /span></button>  -->
111c118,120
<                         <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Empty Cart'); ?>"                   class="button2 btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Empty Cart'); ?></span></span></button>
---
>                         <!--  <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Empty Cart'                  ); ?>" class="button2 btn-empty" id="empty_cart_button"><span><span><?php echo $this->__('Empty Cart'); ?></span></span></button> -->
>                                               <a href="<?php echo $this->getContinueShoppingUrl(); ?>" class="continue_shopping"><span>Co                  ntinue Shopping</span></a>
>                         <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping C                  art'); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Cart'); ?></span></span></button>
113c122
<                         <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping C                  art'); ?>" class="button2 btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
---
>                         <!-- <span class="or">-<?php echo $this->__('or'); ?>-</span>  -->
115,117c124
<                         <span class="or">-<?php echo $this->__('or'); ?>-</span>
<
<                         <?php if($this->getContinueShoppingUrl()): ?>
---
>                         <?php /* if($this->getContinueShoppingUrl()): ?>
119c126
<                         <?php endif; ?>
---
>                         <?php endif; */ ?>
164,165c171,174
<             <?php echo $this->getChildHtml('totals'); ?>
<             <?php if(!$this->hasError()): ?>
---
>             <?php echo $this->getChildHtml('totals'); ?>
>         </div>
>     </div>
>     <?php if(!$this->hasError()): ?>
173,175c182
<             <?php endif; ?>
<         </div>
<     </div>
---
>     <?php endif; ?>

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

The developer should have created a custom template, instead they hashed the default base template and made a mess of things. For those of us with custom templates, we need to observe the patch changes and then reflect them forward into our custom templates so the files are truly patched and the issue goes away.

 

Looks like the developer was trying to turn the cart page upside down, remove a column in the grid, move buttons around, change one of the buttons to use old system calls and rename one of the buttons.

 

Always use translate to change text within translate statements like the following when you're doing your own modifications

 

<?php echo $this->__('Update Shopping Cart'); ?>

 

 

Your plan will work, save the developer modified template somewhere safe with a duplicate to back it up, replace with the original extracted from the archive, apply the patch and then apply the changes to the modified template and copy it back.

 

There is only one change to cart.phtml, the Continue Shopping button, with quote-escaping on a title entity on the "Continue Shopping" button so that any accidents made in translate don't corrupt the html output and quote-escaping the onClick action to prevent XSS.

 

 

-  <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button2 btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
+  <button type="button" title="<?php echo $this->quoteEscape($this->__('Continue Shopping')) ?>" class="button2 btn-continue" onclick="setLocation('<?php echo Mage::helper('core')->quoteEscape($this->getContinueShoppingUrl()) ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>

 

title="<?php echo $this->__('Continue Shopping') ?>"

becomes

title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue Shopping')) ?>"


onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"

becomes

onclick="setLocation('<?php echo Mage::helper('core')->quoteEscape($this->getContinueShoppingUrl()) ?>')"

 

 

 

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

chiefair, thank you for your reply.  Here is what I did, which I found the results odd.  I simply backed up the edited cart.phtml file then overwrote the cart.phtml file with the one from the archive. cleared caches, indexes and recompiled.  I tested a few transactions using the X-POS extension as well as the web both desktop and mobile devices and everything seems to be working fine.  I was then able to patch successfully.  I noticed this file resides in the rwd directy so I'm assuming it is used when responsive design is needed for mobile devices.  However I did not see any issues when using a mobile device.  That being said, I'm not sure what those direct design changes were for! A bit scary but we're going to run with it as-is and see what happens.  

 

Again, thank you for your input it was greatly appreciated!  Any further insight on when and why that file is used would be good knowledge to have.  Maybe I'm not testing thoroughly enough...

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

Well, if your tests for responsive design are showing no issues and no real change after clearing the cache, recompiling and testing on mobile devices, you've entered what I call the "WTF Zone".

 

That's where a developer made changes for no known reason to gain no known result.

 

Been there, spent a lot of time reverting weird stuff to stock Magento to find a) it ran better, b) the code now actually follows Magento conventions and is readable and understandable and c) changing an included CMS block doesn't totally break the site because it needs to have one less opening or closing DIV.

 

Try having a template with lots of comments like "Closing DIV in xxxxxx.phtml" where a meat cleaver was taken to blocks and they were separated over 2-3 templates. Mmm, I dream of having a time machine and one of those Manga hammers pulled out of hammerspace and me working out frustration leaving giant headlumps. All cartoony, nobody gets killed, but the developer learns to never do that again...

 

Sorry, venting here.

 

If stock works run with it, makes your maintenance easier. Just try to determine if the modification was done to the base template and then they switched out RWD for another responsive template. That template, if they created or installed it, will need to be checked for the same two button mods.

Re: SUPEE-6285 patch error hunk #1 at 115 Magento 1.9.1

Very well put! I'm glad someone understands my frustration Robot Mad