+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Return Code 0 when attempting to delete/publish/unpublish item

Return Code 0 when attempting to delete/publish/unpublish item

5 posts, 0 answered
  1. Andrew
    Andrew avatar
    5 posts
    Registered:
    01 Oct 2012
    02 Jan 2013
    Link to this post
    I have created a dynamic content module called Store.  I am attempting to delete/publish/unpublish one of it's items.  It is the only item that I am having issues making modifications to.

    I have attempted to run a service trace but the output isn't providing much meaningful data.  I have attached it.

    I have noticed that in the database under sf_dynamic_content as well as in the stre table that there are 3 entries for the record (temp, live, master).  Even when I am not editing the entry the temp record still exists in the table.  Could that be related to the issue?


    Trace output:
    System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
    System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    Telerik.Sitefinity.Data.Linq.OpenAccess.OpenAccessQueryProvider`2.Execute(Expression expression)
    Telerik.Sitefinity.Data.Linq.OpenAccess.OpenAccessQueryProvider`2.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
    System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
    Telerik.Sitefinity.Taxonomies.TaxonomyManager.AdjustMarkedItemsCount(Type dataItemType, Guid taxonId, Int32 count, String itemProviderName, ContentLifecycleStatus statisticType)
    Telerik.Sitefinity.Taxonomies.TaxonomyManager.AdjustMarkedItemsCount(IDataItem dataItem, Guid taxonId, Int32 count, ContentLifecycleStatus statisticType)
    Telerik.Sitefinity.Taxonomies.Organizers.DefaultOrganizer.AdjustMarkedItems(ITaxonomyManager manager, Guid taxonId, Int32 adjustment, Boolean commitChanges)
    Telerik.Sitefinity.Taxonomies.Organizers.DefaultOrganizer.Clear(String propertyName)
    Telerik.Sitefinity.Data.WcfHelpers.ReflectionHelper.CopyProperties(Object source, Object& destination, CreateInstanceDelegate createDelegate, CanCopyPropertyDelegate canCopyPropertyDelegate, String propertyPath)
    Telerik.Sitefinity.Data.WcfHelpers.ReflectionHelper.DeepCopy(Object source, Type type, CreateInstanceDelegate createDelegate, CanCopyPropertyDelegate canCopyPropertyDelegate, String propertyPath)
    Telerik.Sitefinity.Data.WcfHelpers.DynamicFieldsDataContractSurrogate.GetDeserializedObject(Object obj, Type targetType)
    System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, String name, String ns)
    ReadItemContextOfDynamicContentBJvd3pKJFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )
    System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
    System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
    System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract)
    System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, String name, String ns)
    System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
    System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
    System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
    System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
    System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
    System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
  2. Andrew
    Andrew avatar
    5 posts
    Registered:
    01 Oct 2012
    02 Jan 2013 in reply to Andrew
    Link to this post
    I manually deleted the Temp row's with the following query.  I was then able to delete the row.  Any ideas what would have caused this?

    declare @id uniqueidentifier
    set @id = (select base_id from sf_dynamic_content where url_name_ = 'new' and status = 1);
    delete from stre_areas where base_id = @id
    delete from stre_brands where base_id = @id
    delete from stre where base_id = @id
    delete from sf_dynmc_cntnt_sf_lnguage_data where base_id = @id
    delete from sf_dynamic_content where base_id = @id
  3. Lilia Messechkova
    Lilia Messechkova avatar
    42 posts
    Registered:
    13 Jul 2016
    03 Jan 2013
    Link to this post
    Hi Andrew,

    We have seen other reports about this issue but we were not able to isolate the scenario.

    In theory a temp item should never exist if you are not in editing mode, so it means that something has crashed with the item when it was saved.

    The exception is related to the taxonomies statistics. I guess that this item has its taxonomy field updated. If you can remember what were the steps you did with the item before the problem occurred that could help a lot with detecting the steps to reproduce.

    I am sorry for your inconvenience.

    Kind regards,
    Lilia Messechkova
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Andrew
    Andrew avatar
    5 posts
    Registered:
    01 Oct 2012
    08 Jan 2013 in reply to Lilia Messechkova
    Link to this post
    Thanks for the reply Lilia.  Mentioning the taxonomy statistics has sparked something.  I am having problems modifying certain dynamic module items, I am also having problems assigning certain custom taxonomies to dynamic modules.  This appears to be related to the taxonomy statistics.  I ran a query and noticed that the statistics where duplicated for a particular taxon:

    select * from sf_taxonomy_statistic where taxon_id = '22174114-F1F1-4346-AE93-736C4D74653E'

    I saw multiple entries for the same statistic_type and taxon_id

    I deleted the duplicates and only left one entry remaining per statistic_type for that taxon.  Afterwards I was then able to successfully save the entry.  

    I ran a query and noticed that there are about 87 other duplicated entries in the sf_taxonomy_statistic table.  I want to verify that this is an appropriate solution.  It doesnt appear that the id column in the sf_taxonomy_statistic table is related to any other tables so Im assuming deleting all duplicated rows is ok?  I'd like a confirmation before rolling to production.  

    Here is the duplication query I am executing:
    select count(taxon_id) as how_many_dupes, taxon_id,statistic_type 
    from sf_taxonomy_statistic
    group by taxon_id, statistic_type
    having count(taxon_id) > 1


  5. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    08 Jan 2013 in reply to Andrew
    Link to this post
    Which version are you running?  I remember this being an issue for us, but it was fixed a couple versions ago...

    At the time they gave me this SP which cleaned things up, please backup your DB before running
    /****** Object:  StoredProcedure [dbo].[mp_sp_repairCategoryStats]    Script Date: 2013-01-08 3:26:02 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:      Telerik
    -- What is this: Fixes the 500 Target Invocation
    -- exception that can sometimes occur if there's multiple
    -- stat objects for a category
    -- =============================================
    ALTER PROCEDURE [dbo].[mp_sp_repairCategoryStats]
    AS
    BEGIN
    /****** Script for SelectTopNRows command from SSMS  ******/
    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
     
    END
5 posts, 0 answered