Announcement

Collapse
No announcement yet.

Odd behavior in admin pages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kent Multer
    replied
    Yes, the module checks the Tab code; and all my functions return values as needed. But Thanks for asking!

    This is a large, complex module, and everything else is working pretty-much correctly at this point. Its purposes is to import large amounts of product data from a remote server. The one unconventional thing that it does is self-restart.

    The large quantities of data to import are limited by the Miva global timeout, and also the gateway timeout which apparently can't be changed on a shared server. The module detects when it's almost out of time, stops itself, and writes some extra Javascript to the Module_Utility_Content page. This code, in effect, clicks the Import button again; and the module saves an "offset" variable so it can resume where it left off. It can restart itself as many times as needed until all the data is imported.

    I've used this approach several times in the past, with good results ... but I'm not sure if I've done it in a v9 store before. With all that extra Javascript in the page, there may be some kind of side effect that I haven't run into before.

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    Also, do all the functions that require a return value send a return value? That can easily create strange errors in the admin.

    To add what ids said above, do you have something like this at the top of the utility functions so things don't run unless you're in the right tab?

    Code:
      <MvIF EXPR = "{ g.tab NE l.module:code }">
        <MvFUNCRETURN VALUE = "{ '1' }">
      </MvIF>

    Leave a comment:


  • ids
    replied
    Kent,

    Just a thought regarding your TAB issue. Are you making sure you're validating the current module's tab in the validate function so the module's code doesn't execute in those tabs?

    Scott

    Leave a comment:


  • dcarver
    replied
    Network

    Leave a comment:


  • Kent Multer
    replied
    Which tool? There are quite a few ...

    devtools.png

    Thanks --
    Attached Files

    Leave a comment:


  • dcarver
    replied
    Firefox developer tools. It will show you all the requests the page is making and you can see any and all POSTed form data.

    Leave a comment:


  • Kent Multer
    replied
    Which developer tool would I use for that? I generally use Firefox, but if necessary, I can switch to another browser for testing.

    Leave a comment:


  • dcarver
    replied
    Module_Utility_Validate is only called when the SMOD action is submitted. Maybe a module is doing something weird with that input field? Switching tabs alone should not cause the issue you are describing. I would look at the submitted form data via developer tools and see if the "Action" value is set in the POSTed data just by switching tabs.

    Leave a comment:


  • Kent Multer
    started a topic Odd behavior in admin pages

    Odd behavior in admin pages

    Hi, I'm working on a utility module, and seeing something I can't explain. The module has an error message which is processed in the usual way: Module_Utility_Validate() checks some variables, and if necessary, it makes a call to FieldError() to display a message. The problem is that the message is coming up at times when it shouldn't. Sometimes it even comes up when I click to another tab, when I never touched the Update button.

    I realize that the module has a bug, but that seems very strange to me. Why would Module_Utility_Validate() or FieldError() be called, just by the act of clicking to another tab?

    I know that the admin pages have gotten a lot more complex since v9. Apparently all the values for form fields are passed in with Javascript, instead of just being rendered as part of the HTML like they used to. Maybe that has something to do with this?

    Thanks --
Working...
X