Bug using sc_redir() with target of modal in onExecute in a blank application

Usign version 9.7.021

sc_redir() in a blank application’s onExecute with a target of “modal” fails. However, combing it with an sc_alert() seems to trigger the correct result of the sc_redir(). So, for now, I’ve had to implement this as a work around, but a fix is in order. I’ve also tested using a target of “_self” and it works, so it appears the bug is isolated to the ‘modal’ option.

Here is the code that fails:

sc_redir(form_new_service_design, '', 'modal', 500,250);

Here is the code that works:

$params = array(
 	'title' => 'New Blueprint',
 	'type' => 'info',
 	'timer' => '2000',
	'showConfirmButton' => false,
	'position' => 'top',
 	'toast' => true
 );

 sc_alert("Create a new Service Design Blueprint ", $params);

sc_redir(form_new_service_design, '', 'modal', 500,250);

Dear @edfenech,

After tests carried out in the current version of ScriptCase (9.7.022), the problem was identified in the sc_redir macro with target being modal in the Blank application.

The case has already been reported to the development team, and any news about it, I will be feedback through this topic.

Best Regards!

Thanks @Danilo_Lima. Looking forward to hearing when it’s resolved.

Any progress on this bug? Cheers

Dear @edfenech

First, I’m sorry for the delay in getting back to you on this case.

Due to the release of the new version with support for PHP 8.1, several cases from the previous version needed to be moved to the new version.

The issue in question has been resolved and the fix released in version 9.8.000.

Thank you for getting back to me and I’m sorry I didn’t get back to you earlier.

Best Regards,

2 Likes

Thank you for the update :slightly_smiling_face:

1 Like

In SC 9.8 the error persist…
I need “simulate” the sc_alert to work…

echo '<header>
   <script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
</header>';

// Retorna al Parent
echo '<script>
       Swal.fire({
        icon: "success",
        title: "Nuevo Crédito generado",
        text: "¡El crédito se ha generado correctamente",
        showConfirmButton: true,
        confirmButtonText: "Cerrar"
        }).then(function(result){
           if(result.value){                   
            window.parent.location = "../dashboard_AltaCredito/dashboard_AltaCredito.php";
           }
        });
       </script>';