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

Already on GitHub? Sign in to your account

Working with categories is problematic #160

Closed
Portugao opened this Issue Nov 4, 2011 · 26 comments

Comments

Projects
None yet
5 participants

Portugao commented Nov 4, 2011

Trying to save a record I get this error under php 5.3.8.

Fatal error: Cannot redeclare DoctrineProxy\Zikula_Doctrine2_Entity_CategoryProxy::offsetUnset() in /xxxxx/ztemp/doctrinemodels/Zikula_Doctrine2_Entity_CategoryProxy.php on line 237

Contributor

phaidon commented Nov 5, 2011

I had also problems with the categories. In addition I had also problems with the multiselect option. In the end I programmed an alternative and much more intuitive category module.

Very nice. And very kindly to make it open for other users. Thanks a lot.

Especially because I'm not so happy with the fact, that no one seems to notice these problems??

@ghost ghost assigned planetenkiller Nov 13, 2011

@ghost

ghost commented Nov 13, 2011

@planetenkiller - can you take a look at this?

Contributor

planetenkiller commented Nov 14, 2011

I'm afk from 15.11 - 18.11 so I'll take look at this next Saturday.

@ghost

ghost commented Nov 21, 2011

@planetenkiller: Did you have any luck with this?

Contributor

planetenkiller commented Nov 21, 2011

release-1.3 branch with ExampleDoctrine module: can't reproduce fatal error

@Portugao: can you delete that file (/xxxxx/ztemp/doctrinemodels/Zikula_Doctrine2_Entity_CategoryProxy.php) and try again? If you get the error again then post the contents of the file in a gist(https://gist.github.com/), thanks.

I have deleted this file and got this under php 5.3.8:

Fatal error: Cannot redeclare DoctrineProxy\Zikula_Doctrine2_Entity_CategoryProxy::offsetUnset() in /xxxxx/ztemp/doctrinemodels/Zikula_Doctrine2_Entity_CategoryProxy.php on line 237

Fatal error: Class 'DateUtil' not found in xxxxxx/lib/util/ObjectUtil.php on line 152

The content of the file you will find here:

https://gist.github.com/1383774

Hello,
I have the same problem with php 5.3.8

PHP Fatal error: Cannot redeclare DoctrineProxy\Members_Entity_ViviendaProxy::offsetUnset() in /xxxxxx/ztemp/doctrinemodels/Members_Entity_ViviendaProxy.php on line 322

Methods: offsetUnset,offsetSet, offsetExists, offsetGet and offsetSet are duplicates.
Example:
public function offsetUnset($key)
{
$this->__load();
return parent::offsetUnset($key);
}
public function offsetUnset($offset)
{
$this->__load();
return parent::offsetUnset($offset);
}

Ok. I'm not alone. I started to think I produce this by myself....

Contributor

planetenkiller commented Nov 22, 2011

It's a doctrine or php bug. I'll try to reproduce the bug in a VM (with php 5.3.8). Which zikula version do you use? 1.3.1? git version? older?

1.3.1 -> Build 73

Contributor

rallek commented Nov 23, 2011

same problem here with a MOST generated module

@planetenkiller
Could you reproduce the bug in the meantime?

Contributor

planetenkiller commented Nov 27, 2011

No, I couldn't. Xampp 1.7.7 (php 5.3.8) with ci build Build 73 (project '1.3.1'): ExampleDoctrine modules works (create & edit & view).

Doctrine2 proxy generation code seems to be ok.

Hmmhmm. That does not please me, because I'm not sure now, if there will be a solution next time. It's a phenomenon, that I get this issue only with php >= 5.3.6.
@planetenkiller
Did you try to reproduce with a module that contains relations?

@ghost

ghost commented Nov 27, 2011

I think you need to describe the exactly setup and process you go through to get this error, otherwise we're just fighting in the dark.

Contributor

rallek commented Nov 27, 2011

I created a very simple module with most. One table, nothing specific. It installed without errors. After trying to add one content item I got this error:

Fatal error: Cannot redeclare DoctrineProxy\Zikula_Doctrine2_Entity_CategoryProxy::offsetUnset() in /www/htdocs/w00ada58/zikula/131/ztemp/doctrinemodels/Zikula_Doctrine2_Entity_CategoryProxy.php on line 237

Fatal error: Class 'DateUtil' not found in /www/htdocs/w00ada58/zikula/131/lib/util/ObjectUtil.php on line 152

I can sent this module and also my phpinfo if you want

Contributor

planetenkiller commented Nov 27, 2011

It's a php bug: http://stackoverflow.com/questions/7437132/php-reflectionclassgetmethods-does-not-returns-the-right-number-of-methods

I wrote a test code ( https://gist.github.com/1397476 ):

  • my php 5.3.8 install: every offset* method once
  • on ralleks php 5.3.8 install: every offset* method twice
@ghost

ghost commented Nov 27, 2011

I don't know how this affects the code, but you could determine the methods by getting the methods and then filtering the list for duplicates. I'd also report the bug to php.net

Contributor

rallek commented Nov 27, 2011

Drak asked me to publish here my simple module. Here you are: http://dl.dropbox.com/u/51150063/Croni%200.0.3.zip
Good luck at problem solving!

@planetenkiller
Thank's a lot for your time to search and find the reason of this issue. It's a real pity, that I can't use categories in a module to the satisfaction of everybody.
And it is very good to know it depends on php.

@ghost

ghost commented Nov 28, 2011

Yes, but maybe there is a way around this problem, dont give up: @planetenkiller is a pretty amazing problem solver...

Contributor

planetenkiller commented Nov 28, 2011

doctrine already fixed this bug: doctrine/doctrine2@4571e49#lib/Doctrine/ORM/Proxy/ProxyFactory.php

release-1.3 branch already contains that doctrine bugfix.

Wow! That's great. I'm very thankful.

Contributor

rallek commented Nov 28, 2011

indeed, with 1.3.2-dev build 28 it seems to work now. So QA of 1.3.1 failed ;-)

@ghost

ghost commented Nov 29, 2011

OK so we can push 1.3.2 QA phase then...

@ghost ghost closed this Nov 29, 2011

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment