1

I am currently upgrading a module that uses setContent(), that used to be available for JournalArticle (package com.liferay.journal.model) in 7.3.

I checked the guidelines at: https://learn.liferay.com/dxp/latest/en/liferay-internals/reference/7-4-breaking-changes.html

But I could not find a direct replacement, or anything about its removal.

Did I miss something in the breaking changes documentation? I also checked the github repository, and the method that was on 7.3.x does not seem to be present in 7.4.x.

This is one of the classes I checked when I first noticed the method was gone:

I also checked the public api at for JournalArticles, as in:

Victor
  • 3,520
  • 3
  • 38
  • 58
  • It seems it is related to https://issues.liferay.com/browse/LPS-129058 – jorgediaz-lr Jul 13 '21 at 06:48
  • Perhaps you can reuse the code of JournalArticleDDMFieldsUpgradeProcess see https://github.com/liferay/liferay-portal/blob/master/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/internal/upgrade/v4_0_0/JournalArticleDDMFieldsUpgradeProcess.java – jorgediaz-lr Jul 13 '21 at 07:07
  • Thanks you!, it is a starting point. It is definitely related, as I found this: alter(JournalArticleTable.class, new AlterTableDropColumn("content")); (weird that this is not documented, and how this came to a .x release) – Victor Jul 13 '21 at 14:23
  • 1
    Here you have the code you need: https://github.com/liferay/liferay-portal/blob/c07678e813a8b10967499828a26726f3a3c2b7d9/modules/apps/journal/journal-service/src/main/java/com/liferay/journal/service/impl/JournalArticleLocalServiceImpl.java#L8399-L8426 This updateDDMFields protected method is used instead of the old setContent – jorgediaz-lr Jul 13 '21 at 15:59
  • You seem to be correct. They did a number with this change. Besides the ddmfields we need to set the document in the original class before calling the method to work with its cache. So, extract ddmstructure -> update -> set the document in the original class -> clean cache. So far so good. Except, all methods that call this protected one, also call 3 formatting, one being private. Feels like I will have to rewrite what is in the service util and test to see if the format is maintained...and if the version changes, need to check again. This could have been a public api.. – Victor Jul 13 '21 at 17:16
  • I will get going to check to see if I can make the solution work, and I will post here if it does. – Victor Jul 13 '21 at 17:17
  • It is now documented at: https://learn.liferay.com/dxp/latest/en/liferay-internals/reference/7-4-breaking-changes.html#removed-journalarticle-s-content-field – Victor Oct 06 '21 at 17:40

0 Answers0