You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Ram Sharma (JIRA)" <ji...@apache.org> on 2008/06/09 08:07:45 UTC
[jira] Created: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
------------------------------------------------------------------------------------------------------------------------------------
Key: SHINDIG-367
URL: https://issues.apache.org/jira/browse/SHINDIG-367
Project: Shindig
Issue Type: Bug
Environment: Windows, Apache
Reporter: Ram Sharma
In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
$person = $newPerson;
}
But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
}
$person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Attachment: (was: BasicPeopleService.php.patch)
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Description:
In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
$person = $newPerson;
}
But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
}
$person = $newPerson;
was:
In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
$person = $newPerson;
}
But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
}
$person = $newPerson;
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603490#action_12603490 ]
Kevin Brown commented on SHINDIG-367:
-------------------------------------
I have set the component appropriately. This is a bug in the PHP RESTful API implementation, therefore that is the appropriate component.
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Description:
In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
$person = $newPerson;
}
}
But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
}
$person = $newPerson;
was:
In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
$person = $newPerson;
}
But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
if (is_array($profileDetails) && count($profileDetails)) {
$newPerson = array();
$newPerson['isOwner'] = $person->isOwner;
$newPerson['isViewer'] = $person->isViewer;
$newPerson['name'] = $person->name;
foreach ($profileDetails as $field) {
if (isset($person->$field) && ! isset($newPerson[$field])) {
$newPerson[$field] = $person->$field;
}
}
$person = $newPerson;
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Brown updated SHINDIG-367:
--------------------------------
Component/s: (was: Sample container & Examples)
RESTful API (PHP)
Please stop changing the components for this issue. This *IS NOT* a "sample container and examples" issue. Incorrectly classifying an issue will result in either the issue being ignored (because the people working in that area aren't able to help), or the issue being closed.
Thank you.
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Attachment: BasicPeopleService.php.patch
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Priority: Blocker
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Attachment: BasicPeopleService.php.patch
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Assignee: Chris Chabot
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Component/s: (was: RESTful API (PHP))
Sample container & Examples
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Chris Chabot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Chabot resolved SHINDIG-367.
----------------------------------
Resolution: Fixed
Assignee: Chris Chabot
Thanks for the bug report & fix Ram, that was indeed an error. Fix has been committed
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Assignee: Chris Chabot
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603528#action_12603528 ]
Ram Sharma commented on SHINDIG-367:
------------------------------------
Hi Chris,
Thanks for commiting the fix. I have attached the patch file, with the requisite changes as well.
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Assignee: Chris Chabot
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Attachment: basicpeopleservice.php
This is the updated code for BasicPeopleService.php
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Attachments: basicpeopleservice.php
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603484#action_12603484 ]
Ram Sharma commented on SHINDIG-367:
------------------------------------
Hi Kevin,
So what Component should I choose for this issue.
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Kevin Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Brown updated SHINDIG-367:
--------------------------------
Component/s: (was: Sample container & Examples)
RESTful API (PHP)
Priority: Major (was: Blocker)
Please use components and severity correctly when filing a bug, or else we can't handle it appropriately.
"Blocker" is only used when an issue is preventing a release from taking place. See also: https://issues.apache.org/jira/secure/ShowConstantsHelp.jspa?decorator=popup#PriorityLevels
The "Sample container & Examples" component deals with the code in trunk/javascript.
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: RESTful API (PHP)
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Attachments: BasicPeopleService.php.patch
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Attachment: (was: basicpeopleservice.php)
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Priority: Blocker
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SHINDIG-367) Code was written to return only the
requested profile fields but it was changing the object value right after
the first value check.
Posted by "Ram Sharma (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SHINDIG-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ram Sharma updated SHINDIG-367:
-------------------------------
Component/s: Sample container & Examples
Priority: Blocker (was: Major)
> Code was written to return only the requested profile fields but it was changing the object value right after the first value check.
> ------------------------------------------------------------------------------------------------------------------------------------
>
> Key: SHINDIG-367
> URL: https://issues.apache.org/jira/browse/SHINDIG-367
> Project: Shindig
> Issue Type: Bug
> Components: Sample container & Examples
> Environment: Windows, Apache
> Reporter: Ram Sharma
> Priority: Blocker
> Attachments: basicpeopleservice.php
>
>
> In php\src\socialdata\samplecontainer\BasicPeopleService.php following code is written to return only those fields which are requested by the gadget/client.
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> $person = $newPerson;
> }
> But the line $person = $newPerson; which is inside the foreach loop was resetting the people object just after the first field check. So other fields are getting reset(unset) and not retrieved by the code even after the fields are there in data source.
> I just took out the $person = $newPerson; from the foreach loop and it started retrieving all the requested fields. Now code for the same looks like:
> if (is_array($profileDetails) && count($profileDetails)) {
> $newPerson = array();
> $newPerson['isOwner'] = $person->isOwner;
> $newPerson['isViewer'] = $person->isViewer;
> $newPerson['name'] = $person->name;
> foreach ($profileDetails as $field) {
> if (isset($person->$field) && ! isset($newPerson[$field])) {
> $newPerson[$field] = $person->$field;
> }
> }
> $person = $newPerson;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.