FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cleinte Map Filters "bug"?
#1
When I create a new form and when I user Client Map Filters, 

email -> field_mail
name -> filed_name

...

When a the user login, can see the post are already created, but when the press to ADD a new, nothing happen and tha Admin can see a new entry but empy. Any help?


Thanks in advance Smile
Nelson Costa.
Reply
#2
Hey Nelson,

Great question. I think I'd call this a bug, but one that was done on purpose...

Obviously the point to Client Map filters is that they limit what you see in the View according to whatever rules you set - i.e. it only shows submissions with data that maps to specific values in the account of the user who happens to be viewing the data.

But creating a brand new submission will by default create an *empty* record - and that DOESN'T map to the user, so the submission won't show up in the View. So after creating it you get booted out back to the list view right away & nothing seems to get added.

To get around it, generally you'd just remove the option to add submissions in that View (Forms -> Edit View -> General tab -> "Can add Submissions"). That's by far the simplest workaround. But you could also probably hack around it by using the Submission Pre-parser module to pre-fill the form field you have the Client Map filter set up with, the moment a new submission is added from within the Form Tools UI: and fill it with whatever value is appropriate from the user's own user account. That would ensure that the moment it gets added, that field contains the right value to allow it to appear in the View. 

I'd need to experiment to get it going, but in theory that would work.

But... to return to the main point: I'd say it was a bug. Smile Definitely a UX bug in the very least. Perhaps by entering a Client Map filter it should warn you that the "Add Submission" feature won't work - or even aggressively auto-disable the option altogether (?). Something to keep in mind for future versions of the script, thanks!

Ben
Reply
#3
I had this same issue, my work around was that I created a field called "created_by" and added a piece of code to the submission code to always populate that field with the users username, then just filter buy that username. Now several caveats to this, one any new users that you create, you will need to add the username to an extended field, two for any existing users, you will have to go back and make sure you create the extended field for them in the database, which can be done by editing each preexisting user and copying the username to your new ef field. In my case I just created a script which created the record based on the client id, and copyied the username from the account table.

Paul
Reply
#4
Thanks for the feedback guys, I have to think more about this Tongue
Nelson Costa.
Reply
#5
Ah good call, Paul. That makes sense.
Reply
#6
(Oct 19th, 2017, 4:03 AM)paullittrell Wrote: I had this same issue, my work around was that I created a field called "created_by" and added a piece of code to the submission code to always populate that field with the users username, then just filter buy that username. Now several caveats to this, one any new users that you create, you will need to add the username to an extended field, two for any existing users, you will have to go back and make sure you create the extended field for them in the database, which can be done by editing each preexisting user and copying the username to your new ef field. In my case I just created a script which created the record based on the client id, and copyied the username from the account table.

Paul

Paul wonder ideia, can you share? Where did you insert the code and the code too? Tongue

Thanks in advance
Nelson Costa.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)