Zen Cart Logo
Forums / Bug Reports / [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

[done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Locked

Views: 7,180

Results 1 to 20 of 28
This thread is locked. New replies are disabled.
21 Sep 2006, 4:32 PM
#1
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

[done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Hello

I am running 1.35 however when I try to adjust or amned the category meta tag tiles or keywords I get the following error

1062 Duplicate entry '1-1' for key 1
in:
[insert into welshtartans_zmeta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('monkey', '', '', '1', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Totally stuck - fresh install of 1.35 no upgrading - have added image handle and the improved attributes controller - everything else works fine except the meta tiles and kewords/descriptions.

Any ideas?

Cheers

24 Sep 2006, 8:55 AM
#2
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Hi this seems to be a bug in 1.35 - you can change the meta tag title once - with no issues if you amened it again you get the following error message

1062 Duplicate entry '1-1' for key 1
in:
[insert into kiarantest_135meta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('monkweyq', '', '', '1', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

the only way to get rid of this if you are tweaking tiles for search engines is to delete the page in full and reinstate.

24 Sep 2006, 9:51 AM
#3
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Tried this on the latest 1.3.5 without any of the bug fixes (clean install) and:

1062 Duplicate entry '65-1' for key 1
in:
[insert into meta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('hgfhfhgf', 'hhgfhgf', 'hgfhgf', '65', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.(On MySQL 4.xx)

24 Sep 2006, 9:55 AM
#4
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Sorry - did you get the same issue? (just so I know i'm not going insane)

24 Sep 2006, 10:11 AM
#5
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Yep, the same problem here.

I also tried it on a 1.3.0.2 shop (not a clean install) and after playing with the meta tags for a minute I got:

1062 Duplicate entry '1-2' for key 1
in:
[insert into meta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('gfhgf', 'fghgf', 'hfhgf', '1', '2')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

It seems to happen after the saving the meta tags with empty descriptions once (i think). After that the error keeps popping up, whatever is filled in.

24 Sep 2006, 10:17 AM
#6
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Cheers Paulm

I have a client who is pretty search engine savy and I know he is going to want to tweak these....

If i was more php/database savy I could probably run something to clear the mete tag title fields in the database.

24 Sep 2006, 10:34 AM
#7
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Did a search to see if this is a known issue, but I only found one thread about the same issue (leaving the fields empty when saving is also mentioned there):
http://www.zen-cart.com/forum/showthread.php?t=36817

No solution to be found there atm though :(

24 Sep 2006, 10:37 AM
#8
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

I know google is currenlty not placing the utmost importance on meta tags & descriptions but titles are always important.

Will keep my eyes peeled and see if I can find anything about this in the wiki as well.

28 Sep 2006, 1:39 AM
#9
cntgifts avatar

cntgifts

Totally Zenned

Join Date:
Sep 2005
Posts:
836
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

same problem here any news on this

28 Sep 2006, 5:46 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

How many languages are installed on your site?

I'm unable to reproduce this.

An exact step-by-step set of actions to reproduce this from a fresh install would be helpful. Please indicate whether your list of steps is with or without demo products installed.

28 Sep 2006, 6:47 AM
#11
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

DrByte:

How many languages are installed on your site?I tried it on a clean 1.3.5 install including demo data and using the default English language files only.

But it also happened on a 1.3.0.2 store with 2 lanuages (modified, but thmo no modifications which could couse this problem).

I wil try to describe exactly how it happens later (if still needed then).

28 Sep 2006, 7:03 AM
#12
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

When I select a category and edit the meta tags, and fill in the meta tag tiltle but leave the keywords and description fields empty and press save. Then click edit again and save unchanged

1062 Duplicate entry '34-1' for key 1
in:
[insert into meta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('gfdgfd', '', '', '34', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

There may be other ways to make it happen. The error seems less persistent now though :wacko: (so I suppose I did something different the other day)

28 Sep 2006, 7:23 AM
#13
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

HI Dr Byte

I simply installed 1.35 - in english then add a new category - edit the meta tag title and save - edit it again and this time when I save I get the message above.

I have had the same thing happen on a 1.35 with image handler insatlled and a fresh install - if need be I can give you access to my test site (I have since installed the sefu on the site but this was after)

Cheers

28 Sep 2006, 8:22 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

nuts ... every time I read those posts/descriptions, I read "product" metatags, not "category" ... :rolleyes:

This will be fun ...

28 Sep 2006, 8:54 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

/admin/categories.php
starting on line 240:```
// bof: categories meta tags
case 'update_category_meta_tags':
// add or update meta tags
//die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
$categories_id = $_POST['categories_id'];
if (zen_get_category_metatags_keywords($categories_id, (int)$_SESSION['languages_id']) or zen_get_category_metatags_description($categories_id, (int)$_SESSION['languages_id'])) {
$action = 'update_category_meta_tags';
} else {
$action = 'insert_categories_meta_tags';
}

  $languages = zen_get_languages();
  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
    $language_id = $languages[$i]['id'];

    $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                            'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                            'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

    if ($action == 'insert_categories_meta_tags') {
      $insert_sql_data = array('categories_id' => $categories_id,
                               'language_id' => $language_id);

      $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

      zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
    } elseif ($action == 'update_category_meta_tags') {
      zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
    }
  }

  zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
  break;
  // eof: categories meta tags



change to:```
      // bof: categories meta tags
      case 'update_category_meta_tags':
      // add or update meta tags
      //die('I SEE ' . $action . ' - ' . $_POST['categories_id']);
      $categories_id = $_POST['categories_id'];
      $languages = zen_get_languages();
      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
        $language_id = $languages[$i]['id'];
        $check = $db->Execute("select *
                               from " . TABLE_METATAGS_CATEGORIES_DESCRIPTION . "
                               where categories_id = '" . (int)$categories_id . "'
                               and language_id = '" . (int)$language_id . "'");
        if ($check->RecordCount() > 0) {
          $action = 'update_category_meta_tags';
        } else {
          $action = 'insert_categories_meta_tags';
        }

        $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]),
                                'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]),
                                'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id]));

        if ($action == 'insert_categories_meta_tags') {
          $insert_sql_data = array('categories_id' => $categories_id,
                                   'language_id' => $language_id);
          $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

          zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array);
        } elseif ($action == 'update_category_meta_tags') {
          zen_db_perform(TABLE_METATAGS_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$language_id . "'");
        }
      }

      zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
      break;
      // eof: categories meta tags
28 Sep 2006, 9:00 AM
#16
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

Totally sorted!! thank you very much.

28 Sep 2006, 3:09 PM
#17
cntgifts avatar

cntgifts

Totally Zenned

Join Date:
Sep 2005
Posts:
836
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

yes thank you

31 Oct 2006, 6:23 AM
#18
r_lo avatar

r_lo

New Zenner

Join Date:
Oct 2006
Posts:
29
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

i had same problem, but when i modified the php file and uploaded, when i go into catagories in admin, the page shows ALL admin options in a text based layout, i have to scroll all the way down to bottom to modify, any ideas?

31 Oct 2006, 6:37 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

My first guess is that something was not modified correctly -- a typo, a paste-error, an FTP problem, a line-ending issue, extra files edited, etc.

The most efficient way to get around the problem would be to use v1.3.6 directly...

7 Nov 2006, 6:13 PM
#20
sobebabies avatar

sobebabies

Zen Follower

Join Date:
Sep 2006
Posts:
158
Plugin Contributions:
0

Re: [done 1.3.6] Meta Tag 1062 Duplicate Entry Error - Category Metatags

I am hitting this. I have upgraded and am on 1.3.5. Here is my exact error:

1062 Duplicate entry '73-1' for key 1
in:
[insert into meta_tags_categories_description (metatags_title, metatags_keywords, metatags_description, categories_id, language_id) values ('', '', '', '73', '1')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

What I did to get here was I added some Categories and only put in the Title in the Categories Meta Tags Definitions, no keywords or descriptions. I can't clear out the fields, it always wants to do the INSERT. LMK if you need more info.

I am probably gonna go do the actual SQL in my database with UPDATE statements instead of INSERT to see if I can move forward. (Caveat: I would NOT recommend that you muck about with your db if you don't have a DBA background - nowadays I may play a mild-mannered work-at-home-mom- ha ha, but I used to play a Force To Be Reckoned With and can recall a thing or two, computers have not changed that much in 7 years so raspberries on those of you who pre-judge moms!:smartass: )