Forum


HomeHomePremiumPremiumDevelopmentDevelopmentModule Not Loading As ExpectedModule Not Loading As Expected
Previous
 
Next
New Post
4/2/2014 12:58 PM
 
I developed a module used to display search results but am having problems using it in multiple places on the website. I am at a bit of a loss as to how approach debugging this problem.  If anyone knows what is happening or has any advice, please help and it will be greatly appreciated.  The following is my problem:

In quick simple terms, the module is not loading when accessed via a post back from another page on the website.  The module works fine on one page but does not work when placed on another page.  A more detailed explanation follows....

The site I am working has a search form on every page so a user can easily submit a product search from anywhere on the site.  When the user submits the search, the search variables are posted and the form action is directed to the search results page.

My site is logically divided into several sections, each representing one company within the corporation.  Here is a screenshot of what the page management view looks like, http://s14.postimg.org/8nh7rxy01/Page....  Within each of the sections, there is a search results page that contains an instance of the Search Results module I developed.  When the user is on any page within the Corporate section of the site and submits a search, they are taken to the search results page contained in the Corporate section.  Likewise, if the user is on a page within another section when the search is submitted, they will be taken to the search results page in their current section.

Everything works as expected in the Corporate section.  While on the section homepage I can submit a search and get results.  I can also be on the search results page after submitting a search, and perform another search.

When in other sections of the site, I am not getting the same result.  In any other section, searches are only executing successfully in limited cases.  Searches are executed successfully only when I first navigate to the Search Results, then submit the search while on the search results page.  If I submit a search from any other page, the module does not load and all I see on the search results page is the content from the selected page template.

I have done some debugging and have observed the following:
  •     The code appears to execute the same way no matter where the search submission originates.  
  •     When debugging I can see that the posted search form values are detected, the search is executed, and the HTML string representing search results is created and written to the screen via the innerText property of a DIV tag.
  •     Although the search will work if the search results page is first loaded in the browser, after submitting a search that does not display successfully, subsequent searches from the search results page will fail until the page is manually reloaded without a post back.
  •     When the page fails, nothing is written to the log file.
  •     I suspected a code error so I removed stopped all code from executing by putting a return statement at the start of the page_load.  In this case, I would expect the structural elements of the module to load, but that they would not be filled in.  Even with the code removed, submissions from other pages would not load the module, and submissions from the same page would load the module.

It seems like DNN just isn't loading the module for some reason.  What could be going on here or what should I look at to start a debugging process?

Thanks
 
New Post
4/2/2014 1:25 PM
 

I took a closer look at each page in the page management view and observed an extra module on the working copy of the search results.  The page that works correctly has the HTML Module on the page as well as my Search Results Module.  That module is put on all new pages by default and I must have overlooked removing it when I first created the page.

I added the HTML module to the other search results pages and things started working as expected.

Since things are now working, the question is why?  Why does my module not load during a post back from another page unless the HTML Module is included?  How can I fix my module so it does not need to be coupled with the HTML Module?

 
New Post
4/3/2014 3:58 AM
 
Andy,

Based on the behavior, I would guess that there may be a client side dependency that is being filled by the html module. Without the html module, do you get any script errors in the Firebug console?
 
New Post
4/3/2014 7:59 AM
 

I just ran a test submitting two searches, one with the HTML module on the page and one without.  The feedback on the Firebug console is the same in both cases and I don't see any errors.  The only thing that shows up is information about a GET request for two JavaScript files.

When it fails, the HTML in the Content Pane is:

<div class="DnnModule DnnModule-DNN_HTML DnnModule-846">

 
New Post
4/3/2014 2:59 PM
 

I am now observing the "disappeared" module effect on a page where i have added one of the HTML Modules...  I did a little experimenting and got it to work after adding a New HTML module as well as an existing module from one of the other search pages.  If I remove either, the search results module will disappear.  This is very odd behavior that I do not understand. 

I checked the error console and the logs, but it's still the same and neither are showing  errors.

 I am having a problem figuring out what to isolate in order to debug this.  Usually I back out code and find the problem, but this time, I have backed out all of my custom code that is used for the view and still have the problem.  Without an error, I am trying to fix things that aren't broken and am not getting anywhere.  What do I do?

 Thanks

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentModule Not Loading As ExpectedModule Not Loading As Expected



Try FREE
30 days money back guaranteed