The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Cleinte Map Filters "bug"? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Cleinte Map Filters "bug"? (/showthread.php?tid=28777) |
Cleinte Map Filters "bug"? - nelsondcosta - Oct 13th, 2017 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 ![]() RE: Cleinte Map Filters "bug"? - Ben - Oct 18th, 2017 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. ![]() Ben RE: Cleinte Map Filters "bug"? - paullittrell - Oct 19th, 2017 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 RE: Cleinte Map Filters "bug"? - nelsondcosta - Oct 20th, 2017 Thanks for the feedback guys, I have to think more about this ![]() RE: Cleinte Map Filters "bug"? - Ben - Oct 21st, 2017 Ah good call, Paul. That makes sense. RE: Cleinte Map Filters "bug"? - nelsondcosta - Oct 24th, 2017 (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 wonder ideia, can you share? Where did you insert the code and the code too? ![]() Thanks in advance |