adrian Posted January 11, 2023 Author Share Posted January 11, 2023 @teppo - I think that's a very desirable use case. I use locked fields quite a lot. I guess I just haven't ever needed them together with this module's functionality before. My quick testing also shows that it is working as expected with Inputfield::renderReadyHook. I am not sure I can think of any issues with it at the moment, so I'll probably commit soon. At the moment, all my modules still rely on the file compiler. I guess I just haven't seen the need to break any 2.x installs because it seems to work just fine and once it's compiled the first time, I don't think there is any significant (if any) overhead. Are you aware of any? As for composer - yeah, I probably should - for whatever reason, Composer still doesn't really gel with me so I tend to avoid it when possible :) 1 Link to comment Share on other sites More sharing options...
teppo Posted January 11, 2023 Share Posted January 11, 2023 12 minutes ago, adrian said: At the moment, all my modules still rely on the file compiler. I guess I just haven't seen the need to break any 2.x installs because it seems to work just fine and once it's compiled the first time, I don't think there is any significant (if any) overhead. Are you aware of any? Not really. I've had some issues in the past, mostly related to disk cache getting out of sync or somehow the module compilation itself messing up the code (but such cases have been super rare). Mostly it just feels unnecessary and a bit "off" to have a separate copy of the code and then have the system abstract that layer away. If I could, I would likely disable module compilation entirely from my/our projects (just like template compilation), but there are indeed still some modules that depend on it, so for now it's a no-go ? Link to comment Share on other sites More sharing options...
adrian Posted January 11, 2023 Author Share Posted January 11, 2023 16 minutes ago, teppo said: I'm wondering if there's some use case where current way of getting properties via eval is necessary? You know what, I don't think there is actually a need for it. I was sure there was at the time so I am wondering if PW supported periods in $page->get many years ago (keeping in mind that I actually started using this module in 2015 even though it wasn't public until much later). Or maybe I just wasn't aware back then of the ability to do $page->get('field') vs $page->field in general. Anyway, it's pretty clear that we can now do $page->get('parent.id') so it does look like your solution now works well, so I'll replace it in the next commit. Mind you, I don't really have a problem with eval() in cases like this but I understand the issue of automated scanners picking up on it. 1 Link to comment Share on other sites More sharing options...
adrian Posted January 11, 2023 Author Share Posted January 11, 2023 7 minutes ago, teppo said: If I could, I would likely disable module compilation entirely from my/our projects (just like template compilation), but there are indeed still some modules that depend on it, so for now it's a no-go ? If you ever find that it's just my modules that are holding up this transition for you, let me know and I'll make the change. 1 Link to comment Share on other sites More sharing options...
adrian Posted January 11, 2023 Author Share Posted January 11, 2023 @teppo - new hook, eval replaced, and composer support added in the latest version. Thanks for the feedback! 2 1 Link to comment Share on other sites More sharing options...
teppo Posted January 11, 2023 Share Posted January 11, 2023 Brilliant, thank you Adrian! 1 Link to comment Share on other sites More sharing options...
LAPS Posted January 14, 2023 Share Posted January 14, 2023 On 1/11/2023 at 3:26 AM, adrian said: Thanks for the report @LAPS - it should be fixed in the latest version. Please let me know. @adrian, thanks for updating the module to v0.1.8, which I installed in ProcessWire 3.0.210. I'm using Hanna Code v0.3.2 and Hanna Code Text Formatter v0.3.2 (the latter with module settings Open Tag set to [[ and Close Tag set to ]]). Given in the field description and/or notes I use a hanna code such as [[my-hanna-code-tag attribute1="Some value" attribute2="Some other value"]], when I access the PW Admin > Edit Page (page where that field is used) then I get the error: "Unknown Selector operator: '[empty]' -- was your selector value properly escaped? In /wire/core/Selectors.php line 222". ? Note: the error doesn't occur when using hanna code such as [[my-hanna-code-tag]]. Link to comment Share on other sites More sharing options...
adrian Posted January 15, 2023 Author Share Posted January 15, 2023 @LAPS - I can't reproduce here, but it looks like it's related to a pages find selector in your Hanna PHP code - can you share that? Link to comment Share on other sites More sharing options...
LAPS Posted January 15, 2023 Share Posted January 15, 2023 9 hours ago, adrian said: @LAPS - I can't reproduce here, but it looks like it's related to a pages find selector in your Hanna PHP code - can you share that? @adrian, you are rigth. My Hanna PHP code was wrong (I was using $sanitizer->selectorValue() instead of $sanitizer->pagePathName()). Sorry for my mistake, and thanks again for the module. ? 1 Link to comment Share on other sites More sharing options...
teppo Posted January 15, 2023 Share Posted January 15, 2023 @adrian, I've got one more request (kind of). Earlier you added composer.json, but didn't yet push the project to packagist.org. Would be nice if you could add the module there as well, otherwise it can only be installed by adding the GitHub repository directly. Thanks in advance! ? 1 Link to comment Share on other sites More sharing options...
adrian Posted January 15, 2023 Author Share Posted January 15, 2023 Yep of course - sorry about that. Done now. 1 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