Updating Custom Actions for Plant an App Version 1.28
Audience:
Pro-Coders
Skill Prerequisites:Custom Code Development
This guide provides the required steps to update your custom actions to ensure compatibility with Plant an App version 1.28. These updates involve modifications due to significant changes between versions 1.27 and 1.28. Please ensure that your development environment is upgraded to version 1.28 before beginning this process.
Typical Use Cases
- Ensuring custom actions remain functional after a Plant an App update.
- Leveraging new libraries and methodologies introduced in version 1.28.
Example
Watch a video of a simple project being updated for version 1.28.
Essential Steps for Updating Custom Actions
Upgrade Development Environment:
First, upgrade your development environment to version 1.28 to access the necessary DLL files.Add References:
Include required references in your project:Add a reference to
PlantAnApp.Abstractions.dll:- Right-click your project in Visual Studio.
- Select
Add -> Select Assembly Reference.... - Search for
Plantanapp.Abstractionsand click "OK".
If your action uses
IActionResult, also add a reference toPlantAnApp.Actions.dll.
Namespace Imports:
In your action file, import the following namespaces usingusing:using PlantAnApp.Actions;
using PlantAnApp.Actions.Context;
using PlantAnApp.Actions.Result;Token Context Changes:
If tokenization is used, replace calls fromcontext.ApplyTokenstocontext.Tokenizer.ApplyTokens.Update Data Store References:
Substitutecontext.DataStorewithcontext.Data.Field and Parameters Changes:
- Replace
ContextFieldwithContextObjectField. - Replace
TokenParameterswithITokenizer.
- Replace
Context Entity Changes:
Instead ofContextEntity, useContextObject
Modernizing Migrated Actions
To fully modernize your migrated actions, consider the following steps:
- Switch to
IAction:
Transition fromIActionImpltoIAction.
Use Dependency Injection:
Implement dependency injection through constructor parameters instead ofIoCInjectable.Remove Obsolete Code:
Remove
IoCInjectablefrom inheritance.Discard
[IoCService]decorator.Ensure you add a parameterized constructor to facilitate dependency injection.
Additional Notes
- Ensure all empty usages of
DnnSharp.Common.Actionsare cleaned up from the codebase to prevent compilation errors. - The switch from
TokenUtil.eTokenContexttoPlantAnApp.Tokens.TokenContentContextshould be addressed by importingPlantAnApp.Tokensand usingTokenContentContext.Plain.
Revised 10/24/2025