Chiru/FIWARE-POIDataProvider

get_supported_components() function error

Closed this issue · 4 comments

Hello, I've found an error while reaching the /get_pois and /delete_poi endpoints. The error shows in the apache logs as follows:

PHP Fatal error:  Cannot redeclare get_supported_components() (previously declared in /var/www/html/poi_dp/data_manager.php on line 14

Looking into the source files, I've found out that a file ( "data_manager.php") is imported twice, once in the endpoint file and again in the "util.php" file that is required in the same endpoint , I've solve this by changing the requires so that it is only included once.

I don't know how this is done on GitHub, should I request a push request or you change it yourself?

Hope that helps.

Thank you for reporting the error.
I am not yet very experienced with the GitHub. So, it is easiest, if you
send me the
corrected files as attachment.
BTW. Tell me more about requesting a push request - nice to learn more
GitHub.

BR
Ari

On 2015-11-19 13:04, nncas wrote:

Hello, I've found an error while reaching the /get_pois and
/delete_poi endpoints. The error shows in the apache logs as follows:

|PHP Fatal error: Cannot redeclare get_supported_components()
(previously declared in /var/www/html/poi_dp/data_manager.php on line 14 |

Looking into the source files, I've found out that a file (
"data_manager.php") is imported twice, once in the endpoint file and
again in the "util.php" file that is required in the same endpoint ,
I've solve this by changing the requires so that it is only included once.

I don't know how this is done on GitHub, should I request a push
request or you change it yourself?

Hope that helps.


Reply to this email directly or view it on GitHub
#5.

Hello again, it is a very simple change, I've only changed :
require "data_manager.php" to require_once "data_manager.php" on the following files:

  • util.php
  • get_pois.php
  • delete_poi.php

As far as I know, these files are the only ones that need to be changed, but I haven't had the time to look thoroughly.

I was mistaken, it is called "pull request" and the official GitHub description is:

Create a pull request to propose and collaborate on changes to a repository. These changes are proposed in a branch, which ensures that the master branch is kept clean and tidy.

As I understand it, it is used to add functionality to a repository, not making little changes like this one.

Regards

Thank you, nncas. Correction pushed to the master branch. Please, verify the correction.

Seems to me to be OK. Got none to validate. Closing.