The content types selected at admin/config/people/flexiaccess are used to populate the autocomplete field, but any Node ID may be entered at user/{uid}/flexiaccess and it is not validated.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | flexiaccess_drupal_html_id.patch | 4.3 KB | rudolfbyker |
| #11 | flexiaccess_validation_conditional_on_button.patch | 2.04 KB | rudolfbyker |
| #6 | flexiaccess-content_type_restriction-2984644-6.patch | 2.59 KB | gisle |
| #4 | Proposed_fix_for_issue_2984644.patch | 2.53 KB | rudolfbyker |
| #2 | flexiaccess_validation.patch | 2.38 KB | rudolfbyker |
Comments
Comment #2
rudolfbykerHere's a patch.
Comment #3
rudolfbykerBy the way there is a comment that says:
It's not silly, since $form_state is saved in the database in any case. So just saving the $nid somewhere in $form_state and then using node_load() or some other query is perfectly acceptable.
Comment #4
rudolfbykerSilly me! I forgot two lines in the patch. Here's a new one.
Comment #5
gisleThanks for the patch - however it still needs some work. It gives the error message, but still adds the ACL for the node.
Here is how testing of a clean install of the patched module goes for me:
Comment #6
gisleI think you just forgot to return from validation function before adding nid if there was an error.
Comment #8
rudolfbykerYes, you are right. I was working against the clock while making this patch, sorry.
I would add "return" after the first form_set_error, too, and move node_load to below the first if statement. It seems more consistent that way.
Comment #10
gislefmr wrote,
Of course. Pushed a new version where those tweaks are included.
Comment #11
rudolfbykerThere is still a problem when we try to remove the permissions from the users, since the same validation function runs when any button is clicked. Here I added a conditional to run validation only when the relevant button was clicked.
This patch is against the latest dev version, not against 7.x-1.2
Comment #12
rudolfbykerMy patches were much worse than I thought... You can't add more than one node on the user page. I'll look into it soon.
Comment #13
rudolfbykerOK, I ran into this before. We should use drupal_html_id to generate a unique ID for the AJAX replace wrapper, and then store it in form_state. What happened was that every time the form is replaced, the ID changed. Now only the wrapper inside the form is replaced. The wrapper contains the table and the textfield, but not the buttons.
Comment #14
rudolfbykerPatch at comment #13 seems to work fine when applied to the latest 7.x-1.x-dev version. I'll do some more testing with real users soon.
The 7.x-1.x-dev version is broken since commit https://cgit.drupalcode.org/flexiaccess/commit/?id=3ea7e94f49158247f7479... , which is my fault.
Comment #17
gisleReverted both flawed commits in this issue.
As a result of this patch in comment #13 no longer apply. It needs ta reroll and also a review by the community.