Deleting image - Exception has been thrown by ther target of an invocation
I have a 5.1 sp1 installattion When I try to delete an image from an library I get the attached error. Anyone with an idea?
Markus
@Telerik
@ Telerik
Hi Markus,
The problem looks similar to an issue we've been trying to reproduce locally, but without any luck.
Would you mind running the below script on your database, and let us know if the problems persist?
The problem we have in mind relates to miscalculated taxonomy statistics, where duplicate statistic entries exist for the same content type and taxonID. The script uopdates the records in the database, removing any duplicate entries and combining them into one statistic with the correct number of marked items.
declare
@T
table
(
taxon_id uniqueidentifier,
statistic_type
int
,
data_item_type
varchar
(255),
item_provider_name
varchar
(255),
marked_count
bigint
,
id uniqueidentifier,
duplicated_count
int
)
insert
into
@T
SELECT
[taxon_id]
,[statistic_type]
,[data_item_type]
,item_provider_name
,
sum
(marked_items_count)
as
marked_count
,
CAST
(
MIN
(
CAST
(id
AS
BINARY
(16)))
AS
UNIQUEIDENTIFIER)
,
count
(*)
FROM
[sf_taxonomy_statistic]
group
by
taxon_id, data_item_type, statistic_type, item_provider_name
having
count
(taxon_id) > 1
select
count
(*)
from
@T
delete
[sf_taxonomy_statistic]
from
[sf_taxonomy_statistic]
as
stat
inner
join
@T
as
temp
on
stat.taxon_id =
temp
.taxon_id
and
stat.data_item_type =
temp
.data_item_type
and
stat.statistic_type =
temp
.statistic_type
and
stat.item_provider_name =
temp
.item_provider_name
and
stat.id <>
temp
.id
update
stat
set
marked_items_count =
temp
.marked_count
from
[sf_taxonomy_statistic] stat
inner
join
@T
as
temp
on
stat.id =
temp
.id
Dear Boyan
I did run the script on the DB and was afterwards able to delete the tags and therefor the library with the images.
Don't know how I got to that point so not much help in telling you how to reproduce it. But you solved the case .
Markus
Any chance this is fixed in 5.2? I had this exception after I made a blog post with tags and categories and got this exception. Why does this happen after just adding a couple tags and categories?
Using this SQL also worked for me. I was having this problem in the event module. Trying to edit or delete a specifc event would result in this message. I duplicated the event (be viewing it and copying the details) and noted that the addition of a specific Tag resulted in the event not saving (and displaying the error message). Running the script and forcing the Events module page to refresh fixed it.
I can supplied a log of the .net error by email (cannot attach zips or text to this reply)
Cheers,
Steven.