Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By jayandrewryan
#790077
We upgraded from PM 2.5.1 to PM 3.

I turned on debug on a process where a task was going to a while screen after hitting proceed.

At the bottom of the debug list is:

Error | syntax error, unexpected '='

It doesn't provide a line or anything. Is there a way to get more verbose logging and find out what line it is having issues with?
By jayandrewryan
#790081
Code: Select all
@@DB_CONNECTION = '33673967653c9839f9c40d6085327978';

@@URL_TFM = 'https://'.$GLOBALS[VARS][HS2].'/process_maker_cases/launch_provision_tfm';
@@URL_RSX = 'https://'.$GLOBALS[VARS][HS2].'/process_maker_cases/launch_provision_sonus';

@@URL_ROUTECASE = 'https://'.$GLOBALS[VARS][HS2].'/process_maker_cases/route_case_using_case_number';
@@URL_EMAIL = 'https://'.$GLOBALS[VARS][HS2].'/email/order_email';

@@URL_SWITCH_TNS_DB = 'https://'.$GLOBALS[VARS][HS2].'/tns/set_provisioned_in_switch';
@@URL_SWITCH_TRUNKGROUP_DB = 'https://'.$GLOBALS[VARS][HS2].'/trunk_group/set_provisioned_in_switch';

@@URL_TFM_TNS_DB = 'https://'.$GLOBALS[VARS][HS2].'/tns/set_provisioned_in_tfm';
@@URL_TFM_TRUNKGROUP_DB = 'https://'.$GLOBALS[VARS][HS2].'/trunk_group/set_provisioned_in_tfm';

$order_id = @@ORDER_ID;
$action_type = @@ACTION_TYPE;

switch ($action_type) {
    case 1:
        @@ACTION_TYPE_DESCRIPTION = "Native DID Order";
        break;
    case 2:
        @@ACTION_TYPE_DESCRIPTION = "Non-Native DID Order";
        break;
  default:
  		@@ACTION_TYPE_DESCRIPTION = "Error No Action Selected!";
}

//Get company id and order type using order id
$sql = "SELECT company_id, service_id, order_type_id FROM orders.order WHERE id = '". $order_id ."'";
$result = executeQuery($sql, @@DB_CONNECTION);
@@COMPANY_ID = $result[1]['company_id'];
@@SERVICE_ID = $result[1]['service_id'];
@@ORDER_TYPE = $result[1]['order_type_id'];

//Get customer name and session limit using company id
$company_id = @@COMPANY_ID;
$service_id = @@SERVICE_ID;

$sql = "SELECT name, description FROM infrastructure.service WHERE id = '". $service_id ."'";
$result = executeQuery($sql, @@DB_CONNECTION);
@@SERVICE_NAME = $result[1]['name'];
@@SERVICE_NAME_LABEL = $result[1]['description'];

$sql = "SELECT name FROM entities.company WHERE id = '". $company_id ."'";
$result = executeQuery($sql, @@DB_CONNECTION);
@@CUSTOMER_NAME = $result[1]['name'];

$sql = "SELECT max_allowed_sessions FROM entities.customer_service WHERE company_id = '". $company_id ."' AND service_id ='". $service_id ."'";
$result = executeQuery($sql, @@DB_CONNECTION);
@@SESSIONS_LIMIT = $result[1]['max_allowed_sessions'];


$usr_name = @@USR_USERNAME;
@@LINKTOORDER = "https://".$GLOBALS[VARS][HS2]."/authenticate/index/".$usr_name."/orders/".$order_id;
@@LINKTOORDER_LABEL = "Order Details";

@@LINKTOCOMPANY = "https://".$GLOBALS[VARS][HS2]."/authenticate/index/".$usr_name."/companies/".$company_id;
@@LINKTOCOMPANY_LABEL = "Company Details";
  
@@LINKTOLSR = "https://".$GLOBALS[VARS][HS2]."/tns/lsr_panel/order_id/".$order_id;
@@LINKTOLSR_LABEL = "Port Numbers Using LSR Panel";

    if (isset(@@__ERROR__)) { 
    G::SendMessageText(@@__ERROR__, 'ERROR');
    $myerror = @@__ERROR__;
      unset(@@__ERROR__);
   error_log("JAR error is set as ". $myerror); 
      } else {
    error_log("JAR no error is set ");
  }

Everything works as far as all the variables getting set.
User avatar
By amosbatto
#790083
What happens if you comment out this part?
Code: Select all
    if (isset(@@__ERROR__)) {
    G::SendMessageText(@@__ERROR__, 'ERROR');
    $myerror = @@__ERROR__;
      unset(@@__ERROR__);
   error_log("JAR error is set as ". $myerror);
      } else {
    error_log("JAR no error is set ");
  }
By jayandrewryan
#790115
Now that I have been logging errors on orders I can see that the "error: unexpected '='" is happening PRIOR to the Trigger. This Trigger is used in many places throughout the Process, but fires when the Dynaform is loaded.

Is there any way to get @@__ERROR__ to tell me what line the error is on or where it is being generated? Providing a syntax error with no information isn't terribly helpful.
User avatar
By amosbatto
#790120
In your trigger code add:
Code: Select all
@=errorLast =  error_get_last();
@=errorBacktrace =  debug_backtrace();
Then look in the PM Debugger at the value and you should see the line number and the file where the error occurred.
Then open that file with a plain text editor to investigate.

This might be caused because you have a version of PHP which is not compatible with PM. What version of PHP are you using.
By jayandrewryan
#790324
it goes away in one place and comes back in another.

[Thu Apr 13 23:17:23.968072 2017] [:error] [pid 10593] [client 10.77.2.236:62735] JAR error DEBUG TRIGGER is set at the top as syntax error, unexpected '=', referer: https://stage-processmaker-i.hypercube- ... CTION=EDIT

[Thu Apr 13 23:17:24.000231 2017] [:error] [pid 10593] [client 10.77.2.236:62735] PHP Fatal error: Nesting level too deep - recursive dependency? in /opt/processmaker/workflow/engine/classes/class.case.php on line 921, referer: https://stage-processmaker-i.hypercube- ... CTION=EDIT
User avatar
By amosbatto
#790367
It looks like you have an error in the trigger which fires before the DynaForm (which is the first in its task). Remove the trigger and see if it disappears.

Also what version of PHP are you using and what version of PM? If you don't know, go to Admin > System Information

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]