Islandora-Collaboration-Group / islandora_webform

islandora_webform
GNU General Public License v3.0
6 stars 8 forks source link

PHP less than 7 patch - no null coalescing op #56

Open noahwsmith opened 4 years ago

noahwsmith commented 4 years ago

See https://www.php.net/manual/en/migration70.new-features.php

Islandora is tested against PHP <7, so we can't use features only available for 7.

cc @bondjimbond ref #54

bondjimbond commented 4 years ago

An error in the code:

PHP Parse error:  syntax error, unexpected ')' in /var/www/drupal/sites/all/modules/islandora_webform/submodules/islandora_webform_embargo/islandora_webform_embargo.module on line 25
noahwsmith commented 4 years ago

My mistake- please check again.

bondjimbond commented 4 years ago

Still showing errors:

PHP Parse error: syntax error, unexpected '?' in submodules/islandora_webform_embargo/islandora_webform_embargo.module on line 90

A php -l on the file before your commits will reveal these.

noahwsmith commented 4 years ago

Updated again @bondjimbond

bondjimbond commented 4 years ago

Still getting a 500 error:

PHP Parse error:  syntax error, unexpected 'return' (T_RETURN) in islandora_webform_embargo.module on line 25
Errors parsing islandora_webform_embargo.module
bondjimbond commented 4 years ago

I'm not sure what's going on in that line. Is it like an if/else statement all in a single line?

  if isset($single_record) {
    return $single_record;
  }
  else {
    return FALSE;
  }

Something like that?

emudojo commented 4 years ago

I'll issue a PR this week to add PHP 5 compatibility back.