Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: gevv on October 26, 2020, 02:58:25 PM

Title: SMF 2.1 R3 Bookmarks Mod Problem
Post by: gevv on October 26, 2020, 02:58:25 PM
Hi,

I am using the modified version Bookmarks Mod  for smf 2.1

There was no problem in rc2 version but problem in rc3 version

topics are not added to favorites

forum error message; 

QuoteWhen using the replace mode, the key column is a required entry.

error log;


QuoteType of error: Critical
Change the method of db insert to insert or add the pk field to the key array
Function: addBookmark
Sources/Bookmarks.php (Line 175)

line 175;


array()


how do i solve the problem

thanks
Title: Re: SMF 2.1 R3 Bookmarks Mod Problem
Post by: Arantor on October 26, 2020, 03:00:37 PM
Code (find) Select
$result = $smcFunc['db_insert']('replace', '{db_prefix}bookmarks',
array(
'id_member' => 'int',
'id_topic' => 'int',
),
array(
'id_member' => $id_member,
'id_topic' => $id_topic,
),
array()
);


Code (replace) Select
$result = $smcFunc['db_insert']('replace', '{db_prefix}bookmarks',
array(
'id_member' => 'int',
'id_topic' => 'int',
),
array(
'id_member' => $id_member,
'id_topic' => $id_topic,
),
array('id_member', 'id_topic')
);


The parameter has to align with the unique index on the table.
Title: Re: SMF 2.1 R3 Bookmarks Mod Problem
Post by: gevv on October 26, 2020, 03:14:21 PM
problem solved thanks @Arantor