Autofill not working on prod site, but does work on test site

An addition to what I said above The User element has a User exists validation. When all the problems first started, a new account profile could not be added on the front end or the backend and existing account profiles could not be modified in either place. So, as a test I changed the "in" to from "both" to "front End" and the on from "both" to "new". A new account profile still cannot be added from the front end, but one can be added on the backend IF I change the user element to NOT be a hidden. It appears an existing account profile can be modified both on the front end and in the back end.

I do want the user element to be hidden on the front end as the user should not be able to select another user for this element. Yet on rare instances a new account profile might need to added from the back end. Can this happen on the backend if the element remains hidden?
 
Last edited:
@kimbare - Just to be perfectly clear, no one has touched your production website. we only work on your test site, so any changes to the production site are not from us.

I didn't say you made changes to the production site. What I said is there are account profiles missing that the customers said they didn't delete. I found them when I ran across a lot of child tables (pet and customer order tables) that are missing links to the account profile tables. When I investigated I found the links are missing because the account profiles are missing. When several of the customers were contacted, they said they didn't delete the account profiles.
 
I'm trying to work on the test site atm, but it keeps logging me out, then it takes two or three attempts to get logged back in again.

-- hugh


 
OK, this is unworkable. Every 2 minutes or so, I get logged out. When I try and log back in, first I get this:

Error
You cannot login to the site. Please contact webmaster.

... then I try again and I get this ...

Warning
Your session has expired. Please log in again.

... and on the third try it lets me back in.

Please let me know when that issue is fixed, so I can actually work on the site.

-- hugh
 
Btw, it does seem to be something to do with the 'userexists' validation, but as I can't stay logged in long enough to actuall run the tests I need to run, I can't get any further with it.

I'm not even sure why you have that "user exists" validation on there. That validation is only useful when creating new users in J! with the juser plugin. All it's going to do in this context is prevent the user from submitting the form.

-- hugh
 
Now when I try and login I'm getting errors ...


Notice: Undefined offset: 0 in /xxx/plugins/system/securitycheckpro/securitycheckpro.phpon line 1991
 
(and I strongly suspect it's that 'securitycheckerpro' plugin that is logging me out and causing the login problems)
 
OK, yeah, I give up, this time it only lasted about 10 seconds before dumping me out of the backend, not even enough time to reload the element settings.

let me know when that's resolved, I'll resume.

-- hugh
 
It appears you were trying to login when you were already logged in, and it was set so one user can only login once. I changed that for now. But I'm still getting weird display stuff going on, too. Earlier I was logged in, but as a different superuser. I thought I had logged out but had not. But since we were logged in as different users, it logically should not have caused an issue as I was not actually doing anything to the website at the time. However, I logged out after Mediaateam contacted me and asked if I was logged in. Now it's set so you can login multiple times - don't know why that would be necessary nor desirable, but I changed the setting. Give me about 5 minutes to look at a couple of other things, then you can try again.
 
Hugh, You can try again now.

As far as the the validation in 'does not exist' mode, when I first realized no one could add new account profiles it was set to "does exist". In an attempt to try and get this working since my client's clients were complaining, I changed a lot of things and this was one of them. I was desperate and trying anything and everything. I'm going to change it back and see if things work well.

Update: Why would I change it to "does exist? The statement says "fail validation when username", so why would't it be "does not exist"? Why would the user existing validation fail if they exist? On the front end we want the user trying to add a new Account Profile to be registered. So would the validation fail if they don't exist?
 
Last edited:
I wasn't trying to login multiple times. I was just working on the backend, with a single backend and a single frontend tab. but as long as it doesn't log me out any more, I'm happy. And I managed to stay logged in long enough to actually generate a meaningful error msg ... so ... I think I see where the problem might be ...

Try this. In ...

plugins/fabrik_validationrule/userexists/userexists.php

... at line 50 ...

PHP:
        $result = JUserHelper::getUserId($data);

... try adding this line, so it reads ...

PHP:
        $data = is_array($data) ? $data[0] : $data;
        $result = JUserHelper::getUserId($data);

... and let me know. The clue I'm working on there is that you said it works when not hidden but not when hidden (or the other way round, I forget), and being hidden or not may well affect whether the user ID on the form is submitted as an array or a single value. And the error message I finally managed to see was complaining about an array in a query, which would happen if the value passed to J!'s getUserId() was an array.

NOTE that I disabled (unpublished) both validations on that form. The user one, plus there was one on a 'disclaimer' checkbox, which was failing, and that element was hidden, so I couldn't set the checkbox.

So make that code change, re-enable the user validation, and let me know.

-- hugh
 
I have never had to add code to this before, so I'm not sure where to do that. Are you talking about going to the actual php file - not something in Fabrik? Is this normal to have to get a validation to work?

Also, I'm working in production so I don't conflict with you, and I don't see 2 validations on that element.
 
No, the other validation was on another, hidden element (client_read_and_accepts_product_disclaimer_indicator).

Jjust find this file on your server:

plugins/fabrik_validationrule/userexists/userexists.php

(relative to J!'s root), and edit it to add that line. If you aren't working directly on the server, you'll need to download it with ftp, edit it locally (with your editor of choice, preferably one that gives you line numbers and doesn't mess with line endings - I always recommend notepad++, and strongly advise against using the built in Windows notepad) and re-upload it.

-- hugh
 
Hugh,

I went into test and on line 49 of plugins/fabrik_validationrule/userexists/userexists.php it says:
$result = JUserHelper::getUserId($data);
line 50 is blank

I'm assuming you wante me to replace line 49 with what you said above ?

The other element should not be hidden - we want people to check it.
 
Last edited:
Yup. As per my instructions:

... try adding this line, so it reads ...

PHP:
       $data = is_array($data) ? $data[0] : $data;
       $result = JUserHelper::getUserId($data);

So add that first line above, before the existing one.

-- hugh
 
The other element should not be hidden - we want people to check it.

I didn't hide it, the group it's in is set to "hidden" in the group's Layout settings. So I just turned off validation on that element so I could submit the form.

-- hugh
 
OK. That problem is resolved! There are others I found while trying to fix this, but I will put those in other threads.

I'm a bit confused though. I see there is a profile for the account I set up for you. Were you able to add it on the front end without the code you had me add, or on the backend?

And I don't understand why you had to turn off the validation for the other element to submit the form. We want people to be required to check yes to submit a custom order.

But mark this as closed. We'll deal with the other issues in other threads. I have to go to meetings and will be gone all afternoon.
 
OK. That problem is resolved! There are others I found while trying to fix this, but I will put those in other threads.

Cool. I'll apply that fix to github, so if you update again, the fix will be there, and it'll get folded into the next release.

I'm a bit confused though. I see there is a profile for the account I set up for you. Were you able to add it on the front end without the code you had me add, or on the backend?

That would have been where I turned the validation off, to make sure it submitted without it, ie. confirming it was that validation causing it.

And I don't understand why you had to turn off the validation for the other element to submit the form. We want people to be required to check yes to submit a custom order.

Because, as per my previous reply, you had hidden the group it's in. And without being able to set that element on the form, it fails validation.

We'll deal with the other issues in other threads

I gather we have refunded your support subscription, as we are obviously unable to provide the level of support you want. This will have automatically removed you from the Standard group, so you won't be able to follow up here. You are of course welcome to post in Community, where I'm sure other users will be happy to help.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top