As far as I can tell access is almost always denied.
I'm second guessing myself because apparently 140 people are using 7.x-1.3 without trouble but I'm pretty sure.
The database has a column fiid, which is for the field instance id, however the module is storing the field id in there, not the instance id, so when access is checked using the instance id it generally doesn't match the field id that is stored.
The only way I can see it working for people is if they don't reuse fields and the field instance id is always the same as the field id.
Marking critical as the module doesn't really work with this bug.
Comments
Comment #1
rooby commentedThis patch fixes it for me.
Comment #2
rooby commentedThe downside is it means you have to re-save all your setting.
So I guess this will need an update function to update all the settings for people.
I will leave as needs review for now to get the functionality reviewed and I will add the update function in the next day or two.
Comment #3
mariacha1 commentedThis patch loads the profile view page, but doesn't show me any fields. I am using the "main" profile and am using fields where the field id and instance id match.
I just get the "Main Profile" title.
Comment #4
rooby commentedI'm going to check this out as I have seen it too (strange as I tried it on one site and it worked but on another it didn't).
Comment #5
rooby commentedHere is a new version that should work properly.
Comment #6
mariacha1 commentedYour patch looks good to me. Here's a few screenshots to confirm.
1) The "Name" field only exists once, so its field id matches its field instance id.



Here's the config:
Here's the user page:
Here's what the anonymous user sees:
2) The "Last Name" field exists in another form, so its field id does not match its field instance id.



Here's the config:
Here's the user page:
Here's what the anonymous user sees:
I'm not going to set this to RTBC, though, because it will need an update hook, as you mentioned, to be properly patched to be ported. I'd be happy to take a stab at that if you won't have time within the next few weeks.
Comment #7
mariacha1 commentedHere's the latest version of the patch with an update hook. It re-rolls patch from #5 into the latest dev version.
Comment #8
rooby commentedThanks for the updated patch.
I have a couple of comments:
The update function number should be 7101.
See https://api.drupal.org/api/drupal/modules!system!system.api.php/function... for further information. I might be able to simplify the explanation if that one isn't clear.
A couple of things regarding the sql:
* You can use double quotes around the sql string so that you don't have to escape the internal quotes.
* If you use table aliases it simplifies things a bit.
* You can make it a single string.
For example (there is no Druapl standard for indenting sql though so it comes down to personal preference, you don't have to do it this way):
Functionality wise, I'll try to test it soon.
The main thing to test is having multiple profiles that use multiple instances of the same field.
We might get into trouble when a single fid has multiple ffids.
Comment #9
mariacha1 commentedThanks @rooby! Lots of helpful stuff there, and I'll make changes asap.
It came to me in the night, too, that I neglected to test against multiple profiles with the same field, and, sure enough, this is an issue. I'll need to change the reference to the "entity_type" to instead pull in the "bundle" or possibly refer to the profile id.
Setting back to needs work.
Comment #10
mariacha1 commentedHere's another attempt at an update hook. This completely recreates the original table by dumping all the new values into a temporary table, dropping the original table, and renaming it. I have a feeling this is not the ideal way to do this, but I believe it's less system-intensive doing all the updates in mysql. Criticism is welcome!
I'm attaching a patch and an interdiff between this and #7, although I see now that I've created it that it's not terribly helpful. :)
Comment #11
TBarina commentedI've applied the path in #10 and now it all works perfectly here.
Many thanks.
Comment #12
randallknutson commentedPatch worked for me and the update hook worked as well. This should be good to go and is critical since the main module just doesn't work without it.
Comment #13
jhedstromLooks like this got committed back in October.