Author: Mats Halfvares, Content Studio development team.

Published: 2008-11-13

Applies to:
  • Content Studio ver. 5.1

Type: Bug


In Content Studio version 5.1 updated Ept documents are not included in fulltext searches.


For security reasons, starting with version 5.1 updated Ept documents will change its file extension to .ept. Internally, the fulltext index engine must be informed that .ept documents have text-based content and this is done in an update database trigger. The retail version of this trigger has an error that prevents this.


warning Warning: The actions below is advanced and should be performed by experienced personal only!

If you experience this problem you can run the follwing sql script against your Content Studio database.

DECLARE @ma int, @mi int, @bu int, @vs nvarchar(100);
EXEC [dbo].[pp_CSDatabaseVersion] @ma OUT, @mi OUT, @bu OUT, @vs OUT;
IF @ma = 5 AND @mi = 1
    DECLARE @script nvarchar(4000);
    SELECT @script =
    N'ALTER TRIGGER [dbo].[trg_Element_Upd] ON [dbo].[tbl_Elements] WITH ENCRYPTION FOR UPDATE
    This trigger ensures that the file extension (Fil_ext) of the writeable 
    content is updated whenever the FileName field has been touched.
      IF UPDATE([FileName])
          DECLARE @CID uniqueidentifier
          DECLARE @EID int
          DECLARE @FEX varchar(255)
          SELECT @FEX = [FileName] FROM inserted
          --Get the file extension for this element
          SELECT @FEX = [dbo].[f_FileExtension](@FEX)
          --if the file extension is EPT, .EPT, XML or .XML use .TXT instead.
          IF(UPPER(@FEX) IN (''.EPT'', ''EPT'', ''.XML'', ''XML'')) SELECT @FEX = ''.TXT''
          --Store ID of the element updated
          SELECT @EID = ElementID FROM inserted
          -- Get its writeable content
          SELECT @CID = dbo.f_ContentToEdit(@EID)
          -- update this content but only if file extension has changed
          UPDATE tbl_modules_content SET Fil_ext = @FEX 
             WHERE ContentID = @CID AND [Fil_ext] <> @FEX
    EXEC sp_executesql @script;
UPDATE dbo.tbl_modules_content SET Fil_ext = '.TXT' WHERE Fil_ext = '.EPT';        


This is a documented problem with Content Studio version 5.1 and has been fixed in version 5.2.