0

Supee 11219 Magento 1.9.3.1 Errors during install, Scan shows not installed.

The install kicks back the following errors Hunk #1 FAILED at 34. Hunk #2 FAILED at 68. Hunk #3 FAILED at 106. 3 out of 3 hunks FAILED -- saving rejects to file app/design/frontend/base/default/template/catalog/product/list.phtml.rej

There is no "list.phtml.rej" file in that location. Anyone have any suggestions? 

See below for the all install messages

patching file app/design/frontend/base/default/template/catalog/product/list.phtml Hunk #1 FAILED at 34. Hunk #2 FAILED at 68. Hunk #3 FAILED at 106. 3 out of 3 hunks FAILED -- saving rejects to file

UPDATE If this error is correct then references to this file in the patch begin at 3969 to 3972. I have no idea what to do with all this code or if it all refers to this file any suggestions

 <?php if (!$this->getInGrouped()): ?>
                 var newLink = {
diff --git app/design/frontend/base/default/template/catalog/product/list.phtml app/design/frontend/base/default/template/catalog/product/list.phtml
index 302e8f4b739..52665c09194 100644
--- app/design/frontend/base/default/template/catalog/product/list.phtml
+++ app/design/frontend/base/default/template/catalog/product/list.phtml
@@ -34,6 +34,7 @@
 <?php
     $_productCollection=$this->getLoadedProductCollection();
     $_helper = $this->helper('catalog/output');
+    $_params = $this->escapeHtml(json_encode(array('form_key' => $this->getFormKey())));
 ?>
 <?php if(!$_productCollection->count()): ?>
 <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
@@ -68,10 +69,26 @@
                     </div>
                     <ul class="add-to-links">
                         <?php if ($this->helper('wishlist')->isAllow()) : ?>
-                            <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
+                            <?php $_wishlistUrl = $this->helper('wishlist')->getAddUrlWithCustomParams($_product, array(), false); ?>
+                            <li>
+                                <a href="#"
+                                   data-url="<?php echo $_wishlistUrl ?>"
+                                   data-params="<?php echo $_params ?>"
+                                   class="link-wishlist"
+                                   onclick="customFormSubmit('<?php echo $_wishlistUrl ?>', '<?php echo $_params ?>', 'post')">
+                                    <?php echo $this->__('Add to Wishlist') ?>
+                                </a>
+                            </li>
                         <?php endif; ?>
-                        <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
-                            <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
+                        <?php if ($_compareUrl = $this->getAddToCompareUrlCustom($_product, false)) : ?>
+                            <li>
+                                <span class="separator">|</span>
+                                <a href="#"
+                                   class="link-compare"
+                                   onclick="customFormSubmit('<?php echo $_compareUrl ?>', '<?php echo $_params ?>', 'post')">
+                                    <?php echo $this->__('Add to Compare') ?>
+                                </a>
+                            </li>
                         <?php endif; ?>
                     </ul>
                 </div>
@@ -106,10 +123,26 @@
                     <?php endif; ?>
                     <ul class="add-to-links">
                         <?php if ($this->helper('wishlist')->isAllow()) : ?>
-                            <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
+                            <?php $_wishlistUrl = $this->helper('wishlist')->getAddUrlWithCustomParams($_product, array(), false); ?>
+                            <li>
+                                <a href="#"
+                                   data-url="<?php echo $_wishlistUrl ?>"
+                                   data-params="<?php echo $_params ?>"
+                                   class="link-wishlist"
+                                   onclick="customFormSubmit('<?php echo $_wishlistUrl ?>', '<?php echo $_params ?>', 'post')">
+                                    <?php echo $this->__('Add to Wishlist') ?>
+                                </a>
+                            </li>
                         <?php endif; ?>
-                        <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
-                            <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
+                        <?php if ($_compareUrl = $this->getAddToCompareUrlCustom($_product, false)) : ?>
+                            <li>
+                                <span class="separator">|</span>
+                                <a href="#"
+                                   class="link-compare"
+                                   onclick="customFormSubmit('<?php echo $_compareUrl ?>', '<?php echo $_params ?>', 'post')">
+                                    <?php echo $this->__('Add to Compare') ?>
+                                </a>
+                            </li>
                         <?php endif; ?>
                     </ul>
             </div>
0

This usually means that the file on the filesystem does not match what the patch expects to see. This can happen if the file has been modified.

Search the patch file for the file name referenced by the error. You will see what the patch is expecting to find and delete (lines preceded by "-"), and what it plans to add in replacement (lines preceded by "+"). Note that everything down to the line number must match for the patch to be applied

You can then determine the best way to precede, which may be:

  1. Revert the modifications of the file such that the patch can be applied without error.
  2. Delete the portion of the patch that is attempting to modify the file in question and manually apply the intended change in whatever way is appropriate to file's modified content.

More on manually applying patch changes:

If you elect to edit the file manually, identify the relevant area of the patch by searching for the file name referenced by the error. This will be the area starting with diff --git [file name] and ending before the next line that startes with diff --git.

You will have to work your way down, noting each line starting with -. This is a line (or set of lines) that the patch is seeking to delete. The subsequent line(s) starting with + are those that the patch is seeking to insert in place of the previously deleted lines.

E.g.:

<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>

Should be replaced by:

<li>
    <a href="#"
       data-url="<?php echo $_wishlistUrl ?>"
       data-params="<?php echo $_params ?>"
       class="link-wishlist"
       onclick="customFormSubmit('<?php echo $_wishlistUrl ?>', '<?php echo $_params ?>', 'post')">
        <?php echo $this->__('Add to Wishlist') ?>
    </a>
</li>

This can be tricky because it is necessary to understand how the lines in question work. The patches treat the files as text, so you may see partially updated blocks of code that are complicated to edit accordingly, e.g. if your customized file has altered the logic of a conditional block or a loop.

In this specific case, multiple if statements are being replaced, but the closing <?php endif; ?> is skipped (because it is technically un-changed).

Additional note on .phtml changes and core files:

Please be aware that whether the patch applies successfully or not, it is necessary to manually update any equivalent .phtml files in a site's custom app/design/frontend directories.

Naturally, manual updates are also required for any core files overridden with app/code/local/ versions.

Finally:

Once the change has been manually applied, the relevant section can be deleted from the patch file. This will allow the patch to be applied without running in to the original error.

  • Thank you, If I understand correctly in the error message patching file app/design/frontend/base/default/template/catalog/product/list.phtml Hunk #1 FAILED at 34 means that in the patch for file "app/design/frontend/base/default/template/catalog/product/list.phtml" it failed at line 34 of the patch file? If so I would open the patch file in a text editor and look closer or remove the offending lines and retry. – AJS Oct 29 at 18:52
  • I believe so, though I am not positive about line 34 matching up. If you search the patch for "app/design/frontend/base/default/template/catalog/product/list.phtml" you should find the relevant section. – jiheison Oct 29 at 18:58
  • I have updated my question to include a follow up to this thread. UPDATE If this error is correct then references to this file in the patch begin at 3969 to 3972. I have no idea what to do with all this code or if it all refers to this file any suggestions? see the bottom of my question for the code in the patch file – AJS Oct 29 at 19:46
  • I edited my answer to include more info about how to proceed. – jiheison Oct 29 at 20:22
0

Download clean Magento that matches your Magento version (1.9.3.1), and diff the template in PhpStorm or other way. Save the diff and replace the file with one from clean Magento. Apply the patch and then copy this file to the custom theme directory. After that manually apply the changes from diff to the file copied to the theme directory. There is no specific requirements to the patches to be applied prior to this one on the patch page, but if this doesn't work with the file from clean 1.9.3.1 you may need to download next 1.9.3.* versions to find a right file version that the patch created for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.