-
Posts
11,219 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Image and file uploads not working ("flock() has been disabled")
adrian replied to nikoka's topic in General Support
Do you have access to the php.ini file? If so, simply remove flock from "disable_functions" -
Text output on module config page
adrian replied to cosmicsafari's topic in Module/Plugin Development
Markup is what I do: $f = $this->wire('modules')->get("InputfieldMarkup"); $f->attr('name', 'config_intro'); $f->label = ""; $f->value = "<p>These settings will override those in the main config settings for this page.</p>"; $fieldset->append($f); I think you'll need lowercase "markup" using that approach to field configuration. -
Text output on module config page
adrian replied to cosmicsafari's topic in Module/Plugin Development
Hey @kongondo - I am OT here and not meaning to single you out I was going to PM you, but thought I could make this a friendly public service reminder to hit the "Y" key in Github before posting links to a line of code so they will be correct even after changes to the file. Thanks everyone! -
You might try hooking after: ProcessPageAdd::executeNavJSON This is an example of using that to modify the returned list of pages: https://github.com/adrianbj/AdminRestrictBranch/blob/838858fd36a78df808b7690b4cddcb3a6c25ffa3/AdminRestrictBranch.module#L144
-
Payment base class + PaymentStripe + PaymentPaypal
adrian replied to apeisa's topic in Module/Plugin Development
Yes, I have, although as I mentioned I am not saying it's an awesome service, but it seems to be relatively commonly used in Canada and so I thought it might be helpful for @digitex I have also used PayPal, Sallie Mae, and Frontstream with PW. Lots of options out there -
Payment base class + PaymentStripe + PaymentPaypal
adrian replied to apeisa's topic in Module/Plugin Development
Additionally, you don't need a PayPal account - you can pay with your CC without signing up. I am not defending PayPal - I actually think it's a pretty ugly system to use, but it does mostly get the job done however you need. You'll always have more flexibility with other services though. In Canada, Moneris is a reasonable option - not modern like Stripe etc, but it can be completely hidden from the user - ie everything happens on your site with no redirect. -
@erikvanberkum I just tested on 3.0.60 (I didn't have easy access to 3.0.62 using the PW Version switcher ) and I can actually reproduce the issue you are having. Turns out it's a bug in the PW core in that version. Look at the difference between: 3.0.60 if($languages) $languages->setLanguage($language); 3.0.84 if($languageID) $languages->setLanguage($language); I would recommend upgrading to 3.0.84 to fix the problem! PS - in my experience, 3.0.84 is more stable than the current "stable" version.
-
Might sound a little insignificant to mention, but I have found myself using the GOTO Page ID feature a lot but it was annoying me that there was no way to open the View/Edit links in a new tabs. Well, now you can - just use your standard "new tab" shortcut: middle-click, right-click > new tab, CTRL+left-click, 3-finger click, etc - really handy!
-
Thanks @erikvanberkum - well it is returning 0 as expected, but the first line in your error shows that setLanguage is still being called. Could you please temporarily replace: if($languageID) $languages->setLanguage($language); with: if($languageID) { echo 'test' . $language->name; //$languages->setLanguage($language); } and let me know what you get.
-
Also, next time for string versions, I think you should leave off the trailing period
-
Some nice updates this morning for the Console and the Snippets Runner panels. 1) The code injection feature (the one that lets you run hooks etc at init, ready, and finished) now has better error handling. It will no longer inject code if it detects any type of error (previously it wasn't properly detecting 500 errors). 2) The Console panel now makes use of orange and red icon colors. The orange simply indicates that you are currently injecting code, and the red indicates that there is an error in your code and as such, nothing is being injected. 3) The Console panel now restores the last error to the results section on page load so if you missed the error when you clicked "Run" to register the code, you will see it again as a reminder of what needs fixing. 4) 500 errors in the Console and Snippet Runner panels now show the full error message - previously this had to be tracked down in the browser dev console's Network tab. Hopefully these changes will be nice improvements to debugging code in the Console and Snippet Runner panels. Let me know if you notice any problems. Cheers! PS I have been using the Console code injection feature for all my hook testing lately and really enjoying it.
-
I see - I think I'd still persist with fixing those spex issues - I bet it won't be too difficult, but I obviously won't mention it again
-
Yep! Obviously you can search the code files under site, but also if you turn on the Template Resources panel in Tracy Debugger it will show you where it was defined. Yeah, sorry - good point! @mike62 - you really should upgrade this site!
-
Two options: 1) Admin On Steroids gives a tooltip to show field names and link to edit them: 2) Tracy shows a list of fields (and their values and settings for the page being edited. This is available from the Request Info Panel
-
This is interesting - it might be the MySQL version, but it might also be the MySQL ONLY_FULL_GROUP_BY setting. ProcessWire requires that is removed, but it only gets removed for 5.7.0+ https://github.com/processwire/processwire/blob/3fc9f69da75e1bc4a3f0842f12a57bd6a1b65099/wire/config.php#L897 If you add this to your config.php it might just work: $config->dbSqlModes = array( "5.0" => "remove:STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY" ); That said, I would definitely get an upgrade to MySQL because there could be other issues with that version as well.
-
Hey @bernhard - as I mentioned, I now leave the Dumps Recorder disabled by default and only enable it via the Panel Selector if I need it which is usually only if there are some weird redirects going on that Tracy is missing. The main Dumps panel is now my own version (not the Tracy core) so I can control how it looks and behaves, and also the way it stores consecutive ajax requests. Does that make sense and work for you? I can bring back the "Preserve Dumps" option if it's really needed, but really the new "Preserve Dumps" approach is to enable the Dumps Recorder when needed and when not, just don't load it.
-
Hi @erikvanberkum - sorry for the trouble upgrading. I am wondering if you'd mind helping me debug this please? Firstly, what version of PW and PHP are you running? Could you please go into wire/core/PagesLoader.php and echo $languageID before line 813. It should return 0 and the if($languageID) condition on 813 should fail, but for some reason $languages->setLanguage($language); is being called with $language set to NULL, hence the error you are seeing. It's almost like your version of PHP is treating if($languageID) as true, when it should be false if set to 0 If you can report on these things, hopefully we can figure out what is going wrong.
-
@Robin S - no worries re your custom actions - I totally understand if they are not ready/relevant for public consumption. I also understand where you're coming from regarding module default settings. Generally I don't find it an issue because if the settings page hasn't been saved, then the defaults will be used when running the module so effectively what the user sees is what they will get. But, there are exceptions, and this module is certainly one of them. I have a couple of others as well and I do a settings save on module install to solve this - maybe this should be the standard approach? I can't see any downsides, although I wonder if it is safe to actually remove defaults - what if the module was installed, but the settings db data fields was somehow emptied? I guess you'd have to uninstall and reinstall, but it might be a mess of notices in the meantime, but maybe that is ok as this is not a likely scenario. Not sure how to get everyone on this page though?
-
Don't worry too much about this - I just thought if it was easy, it would be a nice addition to have SVG support.
-
Thanks for the follow up. One option is that I could parse the content off all "action.php" files when loading Setup > Admin Actions, but I want to prevent the need to parse all files every time that is loaded, or the Setup > Admin Actions submenu is triggered (assuming you have some actions checked to show in the submenu). That is why that page grabs the $info from the module config settings, rather than the action.php file. I think this is probably still a good idea. Correct me if I'm wrong, but the issue you are seeing is only because you created an action, save the config settings page, and then later added a $title but didn't save again after the change? If that's what happened, I don't think we need to worry too much about this - what do you think? If you feel strongly about that other issue, I am willing to reconsider, or if you feel like submitting a PR with the changes you'd like to see. Speaking of PRs, am I going to get one with some of your custom actions? If I don't get some soon, I think it's time to ditch all those author info fields - right now that table makes me look like an egomaniac
-
$config->urls->root should usually return "/" Maybe you are looking for $config->urls->httpRoot Or maybe you need to deal with htaccess redirects - in which case, uncomment the lines under section 13 of the .htaccess file.
-
I am not sure why you had issues uploading an SVG in one field. As for why there is no crop/variations - these really aren't that relevant to the a vector file. You could kind of crop by using a clipping mask, but an actual crop is a pretty complex thing that would require a powerful vector editor to achieve because it involves completely changing the paths that make up the Illustration.
-
@netcarver - what about taking this approach instead of those replacements? https://stackoverflow.com/a/22490902/1524576
-
Thanks for the suggestions @Pixrael - I wasn't planning on swapping editors, but I must admit that I do actually like AceEditor (use in Tracy's Console and Template Editor panels). The documentation and API are not great/consistent, but it seems to have the best PHP linting and code completion, at least compared with code mirror. Monaco might be another good option though.
-
Something unusual going on here. This is what I see. You can tell I am at Setup > Admin Actions and a bd($info) on line 552 definitely contains a "title". Any chance you could trace it back to find why it's not working at your end please?