0

I am running Magento CE 1.7.0.2 and I want to apply below two patches.

PATCH_SUPEE-5345_CE_1.7.0.2_v1-2015-02-10-08-11-22.sh
PATCH_SUPEE-1533_EE_1.12.x_v1-2015-02-10-08-19-16.sh

I am running below command to apply first patch.

sh PATCH_SUPEE-5345_CE_1.7.0.2_v1-2015-02-10-08-11-22.sh

But it shows me with some errors shown in below screen.

Implementing Magento security patch

Can you please tell me what is the issue and how to resolve it?

Kenster
  • 23,465
  • 21
  • 80
  • 106
Tahir Yasin
  • 11,489
  • 5
  • 42
  • 59
  • Is /var/www/dev the root directory of your magento installation? – hellcode Apr 24 '15 at 18:26
  • @hellcode yes its root directory of dev instance – Tahir Yasin Apr 24 '15 at 19:40
  • possible duplicate of [Hunk #1 FAILED at 1. What's that mean?](http://stackoverflow.com/questions/14282617/hunk-1-failed-at-1-whats-that-mean) – β.εηοιτ.βε Apr 24 '15 at 19:43
  • @b.enoit.be this question is not duplicate of shared link because this one is only related to Magento – Tahir Yasin Apr 24 '15 at 20:07
  • @TahirYasin it is because that have nothing to do with Magento, but with the patch command. Read the explanation on the link, please. And for TLDR : that means you do have a file which cannot be patched because it has diverged from his version on the stock 1.7.0.2, and this file is lib/Varien/Db/Adapter/Pdo/Mysql.php as the command line is saying it to you. – β.εηοιτ.βε Apr 24 '15 at 20:12

1 Answers1

1

This error mean what your file have some modifications.This is last file which should be changed by patch so you can patch it manually:

  1. Open lib/Varien/Db/Adapter/Pdo/Mysql.php in some editor and go to the line 2672. Near this line you find next code block:

    $query = '';
    if (is_array($condition)) {
        if (isset($condition['field_expr'])) {
            $fieldName = str_replace('#?', $this->quoteIdentifier($fieldName), $condition['field_expr']);
            unset($condition['field_expr']);
        }
    $key = key(array_intersect_key($condition, $conditionKeyMap));
    
  2. Remove this part:

    if (isset($condition['field_expr'])) {
        $fieldName = str_replace('#?', $this->quoteIdentifier($fieldName), $condition['field_expr']);
        unset($condition['field_expr']);
    }
    
  3. Save the file. Patching done.

ToxaBes
  • 1,587
  • 8
  • 17