Updated: Comment #N

Problem/Motivation

I have this error when i create endpoint and go to "Resources" tab (admin/structure/services/list/xxxx/resources)
Parse error: syntax error, unexpected ':' in /home/xxxxx/public_html/sites/all/modules/services/resources/user_resource.inc on line 286

Proposed resolution

I solved the problem for modifying follows lines in user_resource.inc:

286: 'pass1' => isset($account['pass']) ?: '',
287: 'pass2' => isset($account['pass']) ?: '',

To:

286: 'pass1' => isset($account['pass']) ? '' : '',
287: 'pass2' => isset($account['pass']) ? '' : '',

But i dont know if this solution is correct. I do this because i read this in the php documentation of operators and i have php 5.2.17 in the server:

"Since PHP 5.3, it is possible to leave out the middle part of the ternary operator."

Note: First bug report, i hope to do well.

Comments

nireneko’s picture

Title: Parse error: syntax error, unexpected ':' in /home/nireneko/public_html/sites/all/modules/services/resources/user_resource.inc on line 286 » Error on go to Resources tab in a endpoint
marcingy’s picture

Status: Active » Closed (duplicate)