Hi Freddy,
I see that the Thinkstore solution indeed has a problem. This might have to do with upgrading these solutions and the introduction of the Staged strategy. The control procedure code is not truly staged, but rather only using the strategy whilst using the wrong method of inserting data in the prog_object tables.
Here is the correct version, update the control procedure in the Thinkstore solutions' base model:
-- Determine of which type of objects we want to include the translations
declare @type_of_object table (type_of_object int)
insert into @type_of_object
values
(0), --tab
(1), --col
(2) -- dom_elemnt
-- Add the template to the program object
insert into #prog_object_item (
prog_object_id,
prog_object_item_id,
order_no,
template_id
)
values (
'func_tsf_translate',
'func_tsf_translate',
100,
@control_proc_id
)
-- Add the parameters for every translation object
insert into #prog_object_item_parmtr (
prog_object_id,
prog_object_item_id,
parmtr_id,
parmtr_value,
order_no
)
select
'func_tsf_translate',
'func_tsf_translate',
'appl_lang_id',
appl_lang_id,
row_number() over(order by appl_lang_id, type_of_object, transl_object_id)
from transl_object_transl
where model_id = @model_id
and branch_id = @branch_id
and type_of_object in (select type_of_object from @type_of_object)
insert into #prog_object_item_parmtr (
prog_object_id,
prog_object_item_id,
parmtr_id,
parmtr_value,
order_no
)
select
'func_tsf_translate',
'func_tsf_translate',
'type_of_object',
convert(varchar(10), type_of_object),
row_number() over(order by appl_lang_id, type_of_object, transl_object_id)
from transl_object_transl
where model_id = @model_id
and branch_id = @branch_id
and type_of_object in (select type_of_object from @type_of_object)
insert into #prog_object_item_parmtr (
prog_object_id,
prog_object_item_id,
parmtr_id,
parmtr_value,
order_no
)
select
'func_tsf_translate',
'func_tsf_translate',
'transl_object_id',
transl_object_id,
row_number() over(order by appl_lang_id, type_of_object, transl_object_id)
from transl_object_transl
where model_id = @model_id
and branch_id = @branch_id
and type_of_object in (select type_of_object from @type_of_object)
insert into #prog_object_item_parmtr (
prog_object_id,
prog_object_item_id,
parmtr_id,
parmtr_value,
order_no
)
select
'func_tsf_translate',
'func_tsf_translate',
'comma',
-- Use lead to check if it is the last value
case when lead(transl_object_id) over(order by appl_lang_id, type_of_object, transl_object_id) is null then '' else ',' end,
row_number() over(order by appl_lang_id, type_of_object, transl_object_id)
from transl_object_transl
where model_id = @model_id
and branch_id = @branch_id
and type_of_object in (select type_of_object from @type_of_object)
insert into #prog_object_item_parmtr (
prog_object_id,
prog_object_item_id,
parmtr_id,
parmtr_value,
order_no
)
select
'func_tsf_translate',
'func_tsf_translate',
'transl',
replace(transl, '''', ''''''),
row_number() over(order by appl_lang_id, type_of_object, transl_object_id)
from transl_object_transl
where model_id = @model_id
and branch_id = @branch_id
and type_of_object in (select type_of_object from @type_of_object)
I'll create a ticket for this to be corrected.