2

In 5.0.x versions AdminAuditable fields are removed from classes like PageImpl or StructuredContentImpl but they kept

@EntityListeners(value = { AdminAuditableListener.class })

..which cause NullPointerException in AdminAuditableListener because reflected auditable field don't exists

Because of that in 5.0.2 adding a page in admin resulted in the same error but that was fixed in 5.0.3. Now the same thing is happening with adding structured content items.

Based on comparison between the two (I don't understand all broadleaf annotations - scarse non-enterprise documentation) I succeeded to overcome this by extending StructuredContentImpl and annotating it with

@DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.AUDITABLE_ONLY)

My question is: is it really a bug or am I missing something due to low familiarity with broadleaf and low probability that developers made and testers oversaw multiple same bugs on auditable refactoring ?

Zildyan
  • 1,261
  • 9
  • 11
  • Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – rkosegi Nov 14 '16 at 13:45
  • @rkosegi: did you even read whole question ? Question is about bug in internal broadleaf framework which results in NullPointerException. I see that you don't have any references on broadleaf - so why you marked my question as duplicate ? – Zildyan Nov 14 '16 at 13:49

1 Answers1

1

@Zildyan The PageImpl issue you describe in 5.0.2 was fixed in 5.0.3 as you discovered. Your assessment of the DirectCopyTransformMember/AUDITABLE_ONLY is correct. That would be needed so the appropriate columns are available when an Auditable listener is involved. Your workaround for the StructuredContent is also correct.

The approach of using StructuredContentImpl has been removed as the default for content in favor of ContentItems (Enterprise). That is likely why this wasn't surfaced in tests. I'll get this added as an item to be fixed in the community edition.

DColgrove
  • 116
  • 3
  • Thanks. One more thing - "approach of using StructuredContentImpl" will be deprecated in future versions of community editions (possible migration issues) ? – Zildyan Nov 15 '16 at 14:50