Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10213

Enable/disable a line twice does reload the page

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None

      Description

      When you change the status (enable/disable) twice, it force to reload the page. you should be able to set the status as often as you want.

      Analyis:
      after the switch is done the first time, it's rewriting the code that is put on the onclick (they are so many wrong things on that line that I will leave it like that).
      var newAction = 'enableDisable( ' + recordID + ',"' +
      recordBAO + '","' +
      operation + '","' +
      reloadPage + '","' +
      rowId + '"' + ' );';
      cj( fieldID ).attr("onClick", newAction );

      the reloadPage is written between quotes, and in js "0" is true, so next time, it reloads

      This code should be thrown and re-written properly using sane jquery conventions.
      More generally, we should go away from php building an html blob for the links that contains onclick

      X+

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: