Plugin

Developer
Supported

Delete entries and comments

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Milo Creative

     

You must be logged in to post.

‘Your not allowed to delete entry’ after ajax entry creation

General

imjakechapman
imjakechapman

Hey Milo,

Thanks for developing this. Really appreciate it.

Needing a little support on this..

So I have a user profile where the user has ability to create goals.

I have a form that sends an ajax request to dynamically create the new entry, then appends that new goal to the users_goals. All is good so far

While i’m appending to the list I create links dynamically with the new list item, one of which is the ‘delete entry’ link.

I then bind the javascript alert to the newly created link. But if that newly created link to delete the entry is clicked this error comes up.

” You can not delete this goal “

here is the code inside of the “goals/delete” template

{exp:delete:delete_entry entry_id="{segment_3}" error_no_permissions="You're not allowed to delete this goal" error_invalid_content="It seems that this goal has been already deleted" message_success="Goal has successfully been removed."


Heres the weird part. If I just use the back button, or go back to the profile page… and retry the link, it works perfectly fine.


is there something wrong with this?
something wrong with the dynamically created link?


What I did in the mean time was added a redirect back to the profile page, so there is a slight flash but then you can click the link and it deletes entry correctly…

help? :)