david-szabo97 / grav-plugin-admin-addon-revisions

An extension for Grav Admin plugin which adds revisions for pages.
MIT License
11 stars 8 forks source link

Add some fixes for grav 1.7 compatibility #24

Closed cyanonoob closed 4 years ago

cyanonoob commented 4 years ago

There were some issues using this plugin in 1.7. I renamed the autoload-function as that's now also used within Grav, and I added a check on $page so that there's no attempts at calling methods on a null value. Should work again (it does here)!

cyanonoob commented 4 years ago

Just saw part of my fixes was also referenced in a different pull request, was a bit overeager I'm afraid. The other part still stands, though :)

ricardo118 commented 4 years ago

to expand on this, grav plugins now have their own autoload function. You can test/see example by running a new plugin bin/plugin devtools new-plugin command. It would require the src folder to be renamed classes and the composer.json file to be added for autoloading

david-szabo97 commented 4 years ago

Fixed with another PR. Thanks though! Regarding the !$page, I found another solution. Rather than using instances() we should use all(). This also fixes some pages that were not shown.