We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Adding an Alert to the Files / Edit File panel... how?

Development and Programming

JCOGS Design's avatar
JCOGS Design
135 posts
one month ago
JCOGS Design's avatar JCOGS Design

Am hoping to use an extension that hooks into the after_file_update hook to add an alert to the Files / Edit File panel. The documented method for adding an alert fails. The code I am using within the extension to generate the alert looks like this:

ee('CP/Alert')->makeInline('shared-form')
->asIssue()
->withTitle(lang('some_title'))
->addToBody(lang('some_title_desc'))
->defer();

Have confirmed that this code does indeed generate an alert within EE. I have used the title shared-form for the alert (i.e. ee('CP/Alert')->makeInline('shared-form')) since that seems to be what EE uses almost always internally) but it seems not to make any difference what title I use (nor indeed is it clear what purpose the title actually has). I have traced processing of this using a php debugger and can confirm that the code is processed correctly and a suitable element added to the EE Session variable used to accummulate alerts. However the Files / Edit Data panel always generates an alert after a save (to notify either success or failure) and when this second alert is generated when the existing session data is read it always is read as being blank, so my form is ‘lost’ and the only form that appears is the one generated by the Files / Edit Data panel. I am unsure whether this is a bug, or there is some undocumented hoopla I need to follow through to prevent the alert that is created from being lost before the Files / Edit Data success alert is generated. I would value any thoughts / guidance on what I should do to resolve this. EE7.2.15 / php 8.1.16

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.