Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to access array offset on value of type resource #207

Open
sushicodeur opened this issue Jan 28, 2020 · 4 comments
Open

Trying to access array offset on value of type resource #207

sushicodeur opened this issue Jan 28, 2020 · 4 comments

Comments

@sushicodeur
Copy link

I'm not sure why, on my dev machine, with an env under docker I had suddenly this error today : "Trying to access array offset on value of type resource"

It looks like modifying line 138 of lib/CrEOF/Spatial/DBAL/Types/AbstractSpatialType.php like so fixes the error, but I'm not sure why nor where to look for an explanation :

if (!is_resource($value) && ctype_alpha($value[0])) {

If I can be of any help, please give hints to where to look, and what is missing in this issue description :)

@Alexandre-T
Copy link

Alexandre-T commented Feb 20, 2020

I encountered the same problem since I upgrade to Php7.4
I solved it with :

if (is_string($value) && ctype_alpha($value) || is_array($value) && count($value) > 0 && ctype_alpha($value[0])) {
    return $this->getSpatialPlatform($platform)->convertStringToPHPValue($this, $value);
}

return $this->getSpatialPlatform($platform)->convertBinaryToPHPValue($this, $value);

You may perhaps mix solution with the @sushicodeur purpose.

@Alexandre-T
Copy link

PR #209 fixed it.

@amirsalkhori
Copy link

Hi I have this problem
Trying to access array offset on value of type resource.
I change line 138 of lib/CrEOF/Spatial/DBAL/Types/AbstractSpatialType.php like @Alexandre-T solution, But I it is in the vendor and I can use it on my server. I just installed package creof/doctrine2-spatial pakage

@Alexandre-T
Copy link

@amirsalkhori This issue has been fixed in the longitude-one/doctrine-spatial package.

arlin2050 added a commit to grades-paca/doctrine2-spatial that referenced this issue Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants