Certain Transformations not executed

Andy Bochmann asked on March 13, 2019 23:31

Hello,

When editing add an order in the Orders application, the General tab doesn't execute the transformations for the Customer and Company field. I only see:

Customer: Ecommerce.Transformations.Order_CustomerDetail
Company: Ecommerce.Transformations.Order_CustomerCompanyDetail

I notice the same for transformations on the Invoice. Instead of showing the actual value, it only shows:

Ecommerce.Transformations.Order_Address

Ecommerce.Transformations.Order_ContentTableHeaderEcommerce.Transformations.Order_ContentTableEcommerce.Transformations.Order_ContentTableFooter

Other items on the invoice, like invoice number, order data and cost are correct.

I did not find any information in the logs and I haven't found a way to debug this issue. Does anyone have an idea on how to investigate this more or how to fix it?

I'm on Kentico 12.0.13.

Thanks

Recent Answers


Roman Hutnyk answered on March 14, 2019 11:56

Andy,

Could you please provide transformation code that generates output above?

Thanks

0 votesVote for this answer Mark as a Correct answer

Eric Dugre answered on March 14, 2019 13:18

Checking your invoice transformation as Roman suggested could help, but while on the General tab of an order, the transformations are loaded from the "UpdateGeneral" alternative form of the Order class, so these were most likely never modified by anyone, correct?

Can you please check the Event log for any errors that occur when you view these pages? There may be some errors about macros- in these cases, re-signing macro signatures can resolve the issue: https://docs.kentico.com/k11/macro-expressions/troubleshooting-macros/working-with-macro-signatures#Workingwithmacrosignatures-Re-signingmacros. Though, if the issue occurs frequently in other areas of the site, it may indicate some misconfiguration, e.g. the CMSHashStringSalt is not the same in your staging or web farm servers.

0 votesVote for this answer Mark as a Correct answer

Andy Bochmann answered on March 14, 2019 17:11 (last edited on December 10, 2019 02:31)

Thanks for the quick support.

I haven't modified the invoice code, except for adding a logo at the top. Everything else is still the default after installation. The transformations in the Invoice code look like this:

<p>{%BillingAddress.ApplyTransformation("Ecommerce.Transformations.Order_Address") |(identity)GlobalAdministrator%}

I've just checked the Event Log again, it doesn't show any errors when viewing these pages. I've also re-sign all Macros without success.

Here are two screenshots to illustrate the problem:

Image Text

Image Text

0 votesVote for this answer Mark as a Correct answer

Andy Bochmann answered on March 14, 2019 22:37

When comparing my Kentico database with a freshly installed Kentico DancingGoatMvc installation, I noticed that my table Kentico].[dbo].[CMS_Class] table doesn't have a record for Ecommerce.Transformations.

I also noticed, that the [Kentico].[dbo].[CMS_Transformation] table doesn't contain any entries for Orders, whereas the fresh installation contains a lot of order related transformation.

Seems like at some point all those transformations and the CMS_Class got removed from the database. Is there a way to restore those, without breaking the application and database?

0 votesVote for this answer Mark as a Correct answer

Andy Bochmann answered on March 14, 2019 23:44

Good news, I found a solution. I first tried to migrate the missing records directly from the DancingGoatMvc database, but that didn't work, so I tried using Continuous Integration for this task.

These were the steps to restore the missing Transformations:

  1. Take a freshly installed Kentico DancingGoatMvc application
  2. Enabled Continuous Integration in the DancingGoatMvc project and do a full export
  3. Add the E-Commerce Transformation related files to the broken application's CI Repository folder
  4. Also update @global/cms.rolepermission/cmspowerusers because the permissions for the transformations were gone.
  5. Run ContinuousIntegration.exe -r on the broken application. This will restore the missing records
  6. After the import, resign all Macros in the System application

These are the records, that were missing:

@global/cms.classpermission/cms.documenttype_ecommerce.transformations/
@global/cms.classsite/ecommerce.transformations@fb7e4dff0d.xml
@global/cms.documenttype/ecommerce.transformations.xml
@global/cms.transformation/cms.documenttype_ecommerce.transformations/

Those are the files I had to modify. I also modified the updategeneral.xml files because the hash was different. However, I'm not sure if this was necessary and I don't know if other files need to be modified as well. Everything seems to work fine now.

@global/cms.rolepermission/cmspowerusers@2dbb5e9e4b.xml
@global/cms.alternativeform/cms.systemtable_ecommerce.order/updategeneral.xml
@global/cms.alternativeform/cms.systemtable_ecommerce.sku/updategeneral.xml

Thanks

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.