navigation
 Tuesday, January 09, 2007

I've written and revised a reasonable number of DotNetNuke modules, as well as Falafel's course material for DNN, and I think I can probably create binary Private Assemblies in my sleep.

I was a little unnerved, then, when I was getting something ready for an important customer this morning, and discovered some very weird and different behavior in my test environment than in the development environment. Specifically, I had written a module which collected some extended profile information from Joe User when he was logged in, which I didn't want to collect for the host user or for members of the Administrator group. So I'd upload the new module (logged in as host), then log out and go register a new user name, going immediately to the new module page, where the first thing I needed to do was enter the profile information. Dutifully, I would enter the information and submit it. And nothing would get updated. Yet this worked perfectly in my development environment.

Did I say it didn't get updated? That's not exactly true. I was feeling pretty confused, so when Lino the Wise walkd past my office, I grabbed him and said "Boss, I need some help". He listened patiently as I explained the problem, then turned to my keayboard to demonstrate.

And it worked just like it should. Lino laughed, and said it was because he was standing there that the problem got scared and went away. Then so did Lino. And the problem came right back. After a while longer, I got another coworker to come in. And again I explained the problem. And again, the program performed correctly. These two times, out of perhaps a hundred attempts.

I tried lots of things. Rebooting, of course, and iisreset. Clearing out the temporary files. Creating a fresh virtual site with the same name as the old one, then a new virtual site with a different name. Nothing worked.

I finally noticed (while doing some further testing, with a second user name) that the information from a previously logged in user was being displayed. I had been in the habit of logging in as host, uploading the new module, then logging out and immediately registering a new user. I resorted to brute force: I displayed the current user id on the form. When I'd enter and submit the new user's information, I checked and found that DNN's this.ModuleId function said I was userId=1 (host). Since I was disabling profile update through this particular page for host and administrators, my updates were getting thrown away. Apparently the couple of times it did update were when I was explaining the issue to co-workers - thus taking longer, letting the cache time out (??) and by the time I loaded the offending page, everything behaved properly.

I loaded DNN 4.4.0, and the problem went away. I had been developing and testing in DNN 4.3.5, because this was a custom job and that's what the customer was using. And the heck of it is, they (or actually, their users) will probably not ever encounter the problem because of the way the module will be used, one user at a time from computers all around the country. This particular bug hatched to frustrate only the developer. Too bad I didn't find that out more quickly...

posted on January 9, 2007  #    by Rick Miller  Comments [0]
Related posts:
Hello World! for the DotNetNuke scheduler
Installing DotNetNuke 4.0 on your local machine