Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 14:44 #6060

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Following on from the 500 Error's that I've been experiencing when a front-end form is accessible by the public, I just wanted to add that, when the guest/public member clicks save, the record is not saved.

Also, because there is a redirect on the save, the redirect is never performed.

To clarify, the redirect should be automatic to the fly view of the form that was just submitted. This is done completely in the sandbox (not a custom redirect) by adding id to the reuse parameter on the save button.

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 15:27 #6062

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
No problem there.

As you say, it should be automatic, and it is.
In the redirector properties (builder), when you can check 'reset', it means that you are dealing with item layouts in the same view, so same table, so it keeps the current id.

TODO :
Remove you reuse value.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 15:29 #6063

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @admin,

The test project that I created is called com_publicform (Public Form).

It's dead simple; 1 table, 1field, 1 backend collection + a frontend form and fly.

To recreate my test, please feel free to download the component (attached), install locally, set config to allow public create and create a menu item to the enter form.

Part of the message is hidden for the guests. Please log in or register to see it.


Upon saving as a user who is >= to publisher, the record (name field) is stored and the user is redirected to view the fly for that entry (confirm layout) however, if below that group, the record is not saved and the user gets a white page on the current layout (enter).

Hope this helps!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Last edit: by JoomGuy. Reason: ADD FILE ATTACHMENT

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 15:32 #6064

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195

admin wrote: No problem there.

As you say, it should be automatic, and it is.
In the redirector properties (builder), when you can check 'reset', it means that you are dealing with item layouts in the same view, so same table, so it keeps the current id.

TODO :
Remove you reuse value.

Sorry, just to clarify this, it works perfectly when the user is not a public one. I mean, if the user is a publisher (Andrew) for instance, all works OK.

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 15:38 #6065

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Ok. understand better.

Will check it tomorrow.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 13 Dec 2012 15:44 #6066

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @admin,

Great thanks!

The reason that the redirector isn't working is almost certainly because the save does not work (with public user). Therefore, the case where $result = 1 in the redirector is never true (again, for the public only I mean - or at least below publisher).

By the way, just emailed you a zip of the test component as I couldn't attach it.

Look forward to catching you tomorrow!

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 14 Dec 2012 11:03 #6078

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @admin,

I just wanted to let you know that there is a sort of workaround for this that will get me going OK for the moment:
If I grant the public user edit and delete rights in addition to create, the form data is saved OK and they are then redirected to the fly view for the record they just created.

Just to clarify, if only the create privilege exists, the public user can see the form but the data is not submitted.

In my case, this workaround will do just fine because some custom coding working with the session will limit viewing of the record to the current session however, I guess there are cases where this wouldn't be suitable for others.

Best wishes,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 15 Dec 2012 13:34 #6105

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

[FiXED] ACL canCreate() not working for Public 15 Dec 2012 13:37 #6106

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Thanks @admin!!! You are a legend!

K+1

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.079 seconds

  Excellent Tool ! This tool will save you a lot of time writing the same old structure. I've used others but this is really nice for a quick start. Makes a 3 hour task a 15 minute one. Thanks for this extension
dickrundell (JED)
         

Get Started