ryan Posted April 30, 2013 Author Share Posted April 30, 2013 Enhanced debug mode The dev branch also includes an enhanced debug mode in the admin. It's all been cleaned up to look better and provide more info. It also includes a new section that outlines all of the runtime attached hooks currently active in the system: 11 Link to comment Share on other sites More sharing options...
teppo Posted April 30, 2013 Share Posted April 30, 2013 I've got this feeling that hooks debug section is going to be my new best friend. That information could have prevented couple of very nasty situations already. Glad to have it here now, awesome stuff Ryan! 3 Link to comment Share on other sites More sharing options...
nik Posted April 30, 2013 Share Posted April 30, 2013 ..and now I can let go of trying to come up with a less questionable name for a planned module listing active hooks! Working title was Hook*r. 6 Link to comment Share on other sites More sharing options...
teppo Posted April 30, 2013 Share Posted April 30, 2013 "Hook*r, directly from the creator of After Shave Actions".. yeah, that sounds just about right 5 Link to comment Share on other sites More sharing options...
nik Posted April 30, 2013 Share Posted April 30, 2013 "Recommended by Mr. Log Himself", it seems. We're not getting off-topic, are we? 5 Link to comment Share on other sites More sharing options...
Soma Posted May 2, 2013 Share Posted May 2, 2013 That also mean from now on PW doesn't work with prior php 5.3? I updated PW and got an error, but nothing logged or indicating what the error is. I finally also updated to php 5.3 and installed fresh PW and it now works. I'm also for going forward and php 5.3+ is cool, but there's some hostings that still run ~5.2 and I won't be able to update from now on, until they update php. Edit: just seen my hoster has updated and I can run php in 4 different versions. Link to comment Share on other sites More sharing options...
Soma Posted May 2, 2013 Share Posted May 2, 2013 Ok, when I have php 5.3.8 with latest dev. I can't login and get this error on login page (login form isn't visible) Compile Error: Can't inherit abstract function ConfigurableModule::__get() (previously declared abstract in WireHookable) (line 32 of /[removed]/wire/modules/Markup/MarkupCache.module) When I set php to 5.4.10 it works again. Link to comment Share on other sites More sharing options...
nik Posted May 2, 2013 Share Posted May 2, 2013 Soma, I did a quick test with PHP 5.3.10 + latest PW dev and my test site seems to be working ok, login works and so on. But there's no MarkupCache in use there, if that has anything to do with your problem (the error message doesn't necessarily have anything to do with MarkupCache being in use or not, I think). Maybe some cache issue once again? site/assets/cache/Modules.* or APC? Link to comment Share on other sites More sharing options...
Soma Posted May 2, 2013 Share Posted May 2, 2013 Thanks nik. No Markup Cache isn't installed. I also deleted caches, no luck. Don't know about APC if that's even running on that hosting. Link to comment Share on other sites More sharing options...
titanium Posted May 2, 2013 Share Posted May 2, 2013 Thanks nik. No Markup Cache isn't installed. I also deleted caches, no luck. Don't know about APC if that's even running on that hosting. Hi Soma, perhaps you could check phpinfo() for APC. Link to comment Share on other sites More sharing options...
ryan Posted May 2, 2013 Author Share Posted May 2, 2013 That also mean from now on PW doesn't work with prior php 5.3? It should still work fine on PHP 5.2. You won't be able to use anonymous functions, but ProcessWire itself doesn't have any PHP 5.3 requirements yet. I'm thinking we shouldn't have that requirement until the next major version (PW 2.4). Can't inherit abstract function ConfigurableModule::__get() (previously declared abstract in WireHookable) (line 32 of /[removed]/wire/modules/Markup/MarkupCache.module) The error you are running into does sound a lot like a opcode cache error. Though it also could be a PHP 5.3.8 bug–it sounds like PHP doesn't like the fact that MarkupCache implements two interfaces that require a __get() method. That's not actually a problem, but will keep an eye out if anyone else runs into it. Link to comment Share on other sites More sharing options...
Soma Posted May 2, 2013 Share Posted May 2, 2013 ryan, on 02 May 2013 - 15:55, said:It should still work fine on PHP 5.2. You won't be able to use anonymous functions, but ProcessWire itself doesn't have any PHP 5.3 requirements yet. I'm thinking we shouldn't have that requirement until the next major version (PW 2.4). After updating to latest dev all my local installs on php 5.2 stopped working without any error, well just the general "Unable to complete this request due to an error." No error logged in PW or in PHP. So I'm kinda lost here to what the problem might be. Link to comment Share on other sites More sharing options...
ryan Posted May 2, 2013 Author Share Posted May 2, 2013 I just tried upgrading a PHP 5.2.17 install and ran into the same issue as you did. Though the errors got logged for me, and I'm not clear why PHP 5.2 triggers these errors that PHP 5.3 doesn't, but it was easy to fix. I've pushed a couple of small fixes to dev so that it should work with 5.2 again. 1 Link to comment Share on other sites More sharing options...
apeisa Posted May 12, 2013 Share Posted May 12, 2013 A little bit of new fun stuff on the 2.3 dev branch: Anonymous functions and hooks You can now use PHP 5.3+ anonymous functions when attaching hooks. All the syntax below will work either from your template files, modules, or any Wire derived class. If using outside of template files or Wire-derived classes, then replace $this with wire(). Though anywhere that you can use $this you can also use wire(), so syntax is also a matter of preference. I am testing these Anonymous functions and it seems to work on my php 5.4.6 installation, but giving error on 5.3.10. This is what I receive when trying simple hook init with anonymous function: Error: Using $this when not in object context This is the code that is generating the error: $this->addHookBefore('InputfieldPage::findPagesCode', function($event) { $page = $this->pages->get($this->input->get("id")); $event->arguments(0, $page); }); // Yes, findPageCode is not hookable yet, but I have made local modification to it These two installations are on two different servers, so it might be something else than PHP version. Link to comment Share on other sites More sharing options...
apeisa Posted May 12, 2013 Share Posted May 12, 2013 Ok, changing the code to this makes it work in 5.3 also: $this->addHookBefore('InputfieldPage::findPagesCode', function($event) { $page = wire('pages')->get(wire('input')->get("id")); $event->arguments(0, $page); }); It seems $this was removed from closures at some point (https://wiki.php.net/rfc/closures/removal-of-this) but introduced again (since it works in 5.4). 1 Link to comment Share on other sites More sharing options...
SiNNuT Posted May 12, 2013 Share Posted May 12, 2013 In < PHP 5.4 you can't use this inside of closures i think. 2 Link to comment Share on other sites More sharing options...
iNoize Posted September 5, 2018 Share Posted September 5, 2018 Hello, how to fix the sitemap then? The old Paths works fine but in the sitemap.xml are the new paths and generate 404 Errors. Is it possible to generate also the old paths in there ? Link to comment Share on other sites More sharing options...
horst Posted September 6, 2018 Share Posted September 6, 2018 22 hours ago, iNoize said: Hello, how to fix the sitemap then? The old Paths works fine but in the sitemap.xml are the new paths and generate 404 Errors. Is it possible to generate also the old paths in there ? @iNoize, I cannot get the context between your question and this more then six years old thread. (?) If you have posted here by accident, please tell us and I/we can move your post to the right direction. Link to comment Share on other sites More sharing options...
ttttim Posted December 8, 2020 Share Posted December 8, 2020 Hi i've recently changed a bulk of pages using the API for name-id to name-lastname. Only to notice that all the old URL don't work anymore even though the module was installed. Is there a way to add to loop through the pages and set a custom redirect through the API? something like below (of course not a correct code)? foreach($team as $team_member){ $team_member->redirect($team_member-name.'-'.$team-member->id); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now