-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Yeah, a INTERNAL SERVER ERROR 500 doesn't help much.
-
Output pure JSON for ajax calls in process module
Soma replied to gebeer's topic in Module/Plugin Development
It's $this->halt() only for in templates. In modules you don't need to. -
Do you have access to the server error logs? Or have you config->debug already enabled?
-
Sounds like a memory issue. How big is the image?
-
The cheatsheet is PW based. Theres vesion added and comments. Theres couple members having access to it, but nobody seems to have time or care.
-
LogMaintenance A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large. LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis. Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime. Lines: keeps logs to a certain number of lines Days: keeps the log to a certain number of days Bytes: keeps the log to a certain amount of bytes Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank. Per Log Settings There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is: logname:[archive]:[lines]:[days]:[bytes] errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines The module can be found on github for you to check out. It's still fresh and I'm currently testing. https://github.com/somatonic/LogMaintenance
-
I created a Discord Server for anyone to step by and say Hello ? https://discord.gg/3jCQgt5
-
Watch for template settings that are only set to allow http?
-
@Roych there's various examples around. If you read the first post you'll see a link to a gist for a bootstrap navigation. Not sure if that's what you need.
-
Inconsistent behavior of LanguageSupportPageNames and UI
Soma replied to Zeka's topic in Multi-Language Support
For me the first code works perfectly also for alternative languages, but only if you're viewing the correct language ofc. The second example one doesn't work for alternative language with names that are "empty" in DB. -
It's not the Browser cache or something, but the PW page cache in memory. You'd need to reload the $user after your upload and saving image... $u = $users->get($user->id); if($u->profile_picture) { $userImg = $u->profile_picture; echo '<img src="'.$userImg->url.'">'; } Anyway I would recommend to redirect to the page after submit, but then you need to handle errors differently. Like this you would upload the form with a refresh or going back. Also I would rethink the upload folder to be in a folder not accessible from public for security reasons. You can simply use a folder in "site/assets/cache/.uploads" as . folders will get blocked by PW .htaccess. Also you could move the part with the WireUpload into your if($input->post->form_submit) { .... as it's not needed before that.
- 24 replies
-
- 3
-
-
-
- image fields
- image upload
-
(and 1 more)
Tagged with:
-
It's ?u= not ?url=
-
Thanks for the link. I looked at it and it's clear why it's not working. You're not only sharing the url but a lot more like title and text. Have you modified the config for Facebook? This is the share link: https://www.facebook.com/sharer/sharer.php?url=https%3A%2F%2Fwww.playwood.it%3A443%2Fplaywood%2Fen%2Fblog%2Fitaly-is-a-door-the-design-is-the-key-4-9th-april-fuorisalone-zona-lambrate-milano%2F&title=Italy is a door. The design is the key | 4-9th April%2C Fuorisalone – Zona Lambrate%2C Milano&text=PlayWood will be present at Fuorisalone 2017%2C presenting an innovative product that allows you to join different panels of any material to create furniture and modular structures. The PlayWood connector has been thought for temporary spaces%2C… Facebook only allows for an url. Facebook then parses the url and gets the content from your og tags on the page.
-
Yeah nice they works so well. But doesn't help why yours isn't.... So do you have a link to yours or not? Otherwise I can't try to help.
-
I'm not sure, but this has always been like this not something new. However, maybe you have an example of that so we can take a look at? Also maybe this is of interest: https://developers.facebook.com/tools/debug/
-
Ask Facebook. As far as I understand it, it's because FB caches the data and on first call it sometimes doesn't show in the dialog (but when posted or shared again the same url).
-
1. There's a example in the code itself with email: if($email && (strpos($email->value,'@hotmail') !== FALSE)){ // attach an error to the field // and it will get displayed along the field $email->error("Sorry we don't accept hotmail addresses for now."); } Anything the API provides is possible. I can't go into details as there's too much and don't have any examples ready. 2. Of course an array is possible, input->post is also and array. You just have to make it a WireInputData array. https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/wire/core/WireInputData.php 3. "Validation" is per Inputfield and it depends. Some inputfields do some sanitations to make sure an expected format or type of value is given (for example email https://github.com/processwire/processwire/blob/341342dc5b1c58012ae7cb26cffe2c57cd915552/wire/modules/Inputfield/InputfieldEmail.module) but most do nothing at all. You can look at all the Inputfields processInput() method to see what it does. Text and Textarea have some Inputfield settings to strip tags for example. It depends also on what the Form is used for and where you use the data afterwards. It's never an issue to save data to DB ie Pages, it's always about what and where you output the data (website, email, ...).
-
I found by accident, trying to find out why my Chrome does this, that the Chrome "use Hardware acceleration if possible" enabled in settings is the Problem. It seems to have problems then rendering the CSS filter used there.
-
It depends on your image field. If it's multiple you need to select one first. ie $page->images->first->httpUrl():
-
"media" can (as any) or must be set by the options array you give the render() method. $options = array( "media" => $page->image->httpUrl() ); echo $modules->MarkupSociaShareButtons->render($options);
-
It's vanilla install. Yes there seems to be some css filter that breaks the rendering/layout.
-
Yes, even if I install a new version. It's a Chrome "bug" most likely.
-
Yeah same version Chrome on OSX. Can nobody see this is broken?
-
Yeah new master! (Upgrading from my local install doesn't work anymore) Installs manually... opens ProcessWire backend. Editing Page, images in grid view in Chrome is broken (seems to be ok in FF). Well done and tested!