zikula / core

Zikula Core Framework
GNU Lesser General Public License v3.0
237 stars 67 forks source link

use DoctrineExtensions\Paginate\Paginate; does not work #890

Closed cmfcmf closed 11 years ago

cmfcmf commented 11 years ago

Using a MOST 1.3.5 module, it has the use statement you see above in his Entity Repository. But this gives an error: Fatal error: Class 'DoctrineExtensions\Paginate\Paginate' not found in src/modules/testmod/lib/testmod/Entity/Repository/Base/Test.php on line 434

This is because the DoctrineExtensions of the vendor "beberlei" are missing.

Guite commented 11 years ago

In 1.3.6 there are other classes which must/should be used instead. Background is that a newer Doctrine version is used.

More information here:

Seems to be a similar situation like the updated Sluggable behaviour (means a BC break here).

cmfcmf commented 11 years ago

Adding "beberlei/DoctrineExtensions": "dev-master" to composer solves the problem. I'm not sure why it is not in there @drak.

Edit: Thank you @Guite.

ghost commented 11 years ago

@cmfcmf If my memory is right, it's because the paginator functions were added to Doctrine ORM itself making this extension unnecessary, see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/pagination.html

cmfcmf commented 11 years ago

Yes, but they have different class names: Before: DoctrineExtensions\Paginate\Paginate; Now: Doctrine\ORM\Tools\Pagination\Paginator;

IMHO we should leave this extension in the core for BC reasons.

ghost commented 11 years ago

Ok, but with clear instructions it will be removed in the next major version - i.e. it's now deprecated and must be refactored.

ghost commented 11 years ago

@cmfcmf can you make a PR and include a note in the UPGRADING-1.3.6 documentation.

cmfcmf commented 11 years ago

Doesn't seem to work, I'll check it: http://support.zikula.de/module-CMS_Support_Forum-viewtopic-topic-31278-start-15.htm#pid148652

craigh commented 11 years ago

The pagination in dizkus is working but I don't remember which one it uses.

ghost commented 11 years ago

@cmfcmf specifically what does not work. What error do you get now? This ticket is about a missing class.

cmfcmf commented 11 years ago

I just checked and it works for me under 1.3.6 even with the Eternizer module. @phaidon Please feel free to reopen if it still does not work for you using the latest core.