Leaderboard
Popular Content
Showing content with the highest reputation on 05/20/2019 in all areas
-
I found the issue! I'll file a report on github and link it here when I'm done. https://github.com/processwire/processwire-issues/issues/8855 points
-
Hi @cjx2240 I am pretty sure that your $user->get() call return an NullPage, and that is what confuse you. Try this : if($users->get("$newuser->userid")->id) { // user exist } else { // user DO NOT exist }2 points
-
@NorbertH you could give a try to a theme I made but still not released: https://github.com/flydev-fr/AdminThemeGitKit Still not finished but already cool. To make the theme more condensed, in the theme settings, you can use the following options : - Layout + Interface > Inputfield column width > Select option B (percentage-based) - Forms + Input > Select option Small - Primary CSS file should be set to : site/modules/AdminThemeGitKit/uikit/dist/css/uikit.git.min.css Feedbacks welcome ?2 points
-
In the RTE, when inserting a link, there are several input fields that can be used to select a page, including a text input field that will auto-complete with pages on the site. When inserting an image, there is only an option to navigate the page tree. (equivalent to the second input option 'Select Page...' on the Insert Link screen from the RTE. When inserting an image from another page buried somewhere in the page tree, if you know the name of the page, it would often be quicker to use an auto-complete text field than 'Select Page...' option. It would be nice if the image insertion dialog offered the same functionality as the link insertion dialog so that when selecting a page it's possible to choose either to navigate the page tree, or have a text auto-complete field.2 points
-
Hey @gregg! If possible, please try updating the module to the latest version (0.12.0). This should resolve your issue. For the record, Fields::delete() expects an object implementing the Saveable interface as its first argument – so the correct syntax would be something along the lines of $fields->delete($fields->get('thefield')). Since you cannot use this method to delete a field that has been added to one or more fieldgroups (via templates), that might still fail though ?2 points
-
Finally fixed @arjen's issue, culprit was a non-readable file within the pwpc directory which wasn't excluded since I forgot exclusion paths need to be site relative (/site/assets/pwpc/ for all ProCache users).2 points
-
Due to the tooltip problem, the only safe way to copy anything from the forum is to quote the message and then copy from the message composing area.2 points
-
Imagine you have a nice conversation with someone and only a few hours afterwards you are knee-deep into a module and possibilities you never thought of. Thank you @bernhard for hijacking my plans for the weekend. ?2 points
-
Not stated on each product page but this seems to apply to each product of Ryan: "7 days of purchase and we will refund your money in full." see: https://processwire.com/store/pro-drafts/#warranty-support-refunds I'd recommend purchasing it on Thursday, and spending the weekend on evaluating it. Also note that usually Ryan has time to promptly reply to support questions around weekends (form Friday to Sunday), which is worth taking into account if you also want to ask questions while evaluating.1 point
-
@flydev Thank a lot. You brought me to mind that I have been testing the performance of some queries and declared in the config. $config->dbCache = false; ?♂️1 point
-
This must be really simple, I don't know what I'm doing wrong I'm trying to create a simple import for users, but it's not working. I want to check if they exist already, because I'll update their details if they do, and create them if they don't. Can someone tell me why this is returning true for $users->get("username") when the user definitely doesn't exist? I have tried various combos, with or without quotes, using "name=", but that shouldn't matter because it should be returning false either way.... Truthfully I think you're going to point out something really stupid/basic logic I'm missing which I'm blaming on sleep deprivation $users = wire('users'); foreach($newusers as $newuser) { if($users->get("$newuser->userid")) { echo $newuser->userid." already exists<br>"; } else { // create the user } } Edit: Why is it I frequently work these things out minutes after asking on here... ? The answer is that $users->get(name) returns a PageArray object regardless of whether it matches a user. You have to check if that user has an ID or such instead.1 point
-
What do you mean by "otherwise independent"? It is easy to have two pw instances connecting to one DB (just put the same in config.php), but that makes no sense in a production/dev environment. Adding a field to one site means you'll also have it in your other site. If your code does not reflect that (in BOTH instances), you'll get into trouble (php errors). And you don't want to have those DB changes on the live system instantly of course! Imagine you want to try adding a new "lorem ipsum" news entry... you'll instantly have it on your live system! You have two options: 1) Duplicate your live website to the dev environment, make changes, test everything, push the changes back to live --> this works only if you don't have any changes to the DB on your live system while you are developing/testing on your dev system 2) Migrations https://processwire.com/blog/posts/introduction-migrations-module/ https://weekly.pw/issue/261/#new-module-rockmigrations (thx @teppo for listing it)1 point
-
Thank you all for you quick answers! Seems that I was unclear about the problem. The main problem is that the Inputfield behaves different wether it is loaded instantly or via AJAX. When loaded directly, the field does NOT upload the file instantly. When loaded via AJAX, the file IS uploaded instantly and throws an error. I'm not trying to find a quick solution, I'm trying to find a universal solution that works in both scenarios (because I'm developing a module that can be used anywhere and anyhow (as AJAX or non-AJAX). So the main problem is that I don't know WHY the field behaves different and so I don't know HOW I can modify this behaviour! I'm a bit confused about this error. The network entry shows an empty 200 return, but when I set a breakpoint the responseText is some RockGrid markup: So this error might have something to do with RockGrid. But I'm not worried about this error because the upload has to fail since there is no page to upload the file to. What I want to achieve is that the field does NOT upload the file instantly and only submits the file on form submit. Just like the PW module installer does. In general yes, but there is a way to upload files via InputfieldFile (see the module installer for example). You just need to set a destinationPath property and you can then process this file. This works just fine when the field is loaded non-ajax. I hope I could explain it a little better now ? Thx for your help!1 point
-
Yes. can depend on the server config.1 point
-
In this post we take a quick look at the new version of ProFields Repeater Matrix, yet another new version of FormBuilder, and a new version of the GoogleClientAPI module— https://processwire.com/blog/posts/lots-of-module-updates/1 point
-
Hi Zeka, No mystery here, you get an error because you have SQL_NO_CACHE in more than one statement. It's also not permitted in sub-queries. What is your MySQL server version ?1 point
-
Well, there's a plethora of PW sanitizer methods: https://processwire.com/api/ref/sanitizer/ A good combo might be: https://processwire.com/api/ref/sanitizer/chars/ https://processwire.com/api/ref/sanitizer/min-length/ And of course native PHP has many methods you can use in addition to the PW API functions (some of them are just wrappers or combinations of native methods).1 point
-
Did you check for bad characters? Had this sometimes with copy&paste code from the forum. Modified the script a little to hopefully display a reasonable error message.1 point
-
@AutofahrnDanke for your hard work on this. I really appreciate it. I've excluded both pwpc and added the regex to the config. No luck. I then changed the "Absolute path of the directory where packages are saved." to the ../public folder. No luck either. Funny thing is though that the log says it still wants to save in the "default" folder. When I add your code I'm getting a "Parse error: syntax error, unexpected '$res' (T_VARIABLE)". I've double check the syntax, but it seems to be okay. Not sure what is going on there as well. I also removed all filecompiler files and let it recompile again. No luck.1 point
-
@arjen quickly seeked the log and do not found anything wrong. In that log closing happens at 0.5s and opening at 2.7s so everything seems to work fine a the time between close and open indicates the time for zip operations to take place. You may give it a try and place the backups in some other location (i.e. next to the .../public folder or in .../public/backup), but I doubt this helps, since the logfiles are there. I can only guess that the $zip->close() fails for some reason, so please try changing that block to read: $zipLog->verbose("CLOSING ZIP: {$zipfile}"); $res = $zip->close(); if($res !== true) { $zipStatus = $zip->getStatusString(); $zipLog->verbose("CLOSE ZIP FAILED: {$zipStatus} in {$zipfile}"); throw new WireException("Unable to close ZIP ({$zipfile}): {$zipStatus}"); } $zipLog->verbose("OPENING ZIP: {$zipfile}"); Since I expect the close to fail I've read the complete log and saw, that it tries to zip temporary files generated by ProCache. So its probably worth to add an exclude for ProCache: %/ProCache-[^/]+$% # Ignore ProCache directory and maybe the pwpc directory as well: /site/assets/pwpc/ Edit: forgot that exclusion directories must be site-relative (so its /site/assets/pwpc/ not /pwpc/)1 point
-
Nice @bernhard. You rock!1 point
-
Hi! Been doing some basic Twilio implementation for a client to enable them to automatically send text messages to registered users on page publish. As an upshot, I thought I would strip out the site specific work and stick up on github here: https://github.com/benbyford/TwilioChannels This modules pulls in the Twilio APi and enables you to send SMS messages from your front or backend. Send SMS message Truncate message to single message character limit Auto-select number from range of numbers depending on $To number country of origin–this enables you to send messages with a local number to that user if one added to the config. Templates usage: $twilio = $modules->get("TwilioChannels"); $twilio->sendSMS($toNumber, $message);1 point
-
Just had a very interesting conversation with @wbmnfktr and wanted to share this little preview of a quite big upgrade coming soon called "RockGridActions". I'll share some more infos soon. The great thing about it is that it is built modularly so that we'll be able to use it almost plug&play for RockTabulator ( @Beluga)1 point
-
Are you aware that you can fully rewrite the UIKit admin theme? Just copy the wire/modules/AdminThemeUikit folder to site/modules/. The next time you load a page in the backend, PW will ask you which version you'd like to use. You can even choose if you'd like to use SASS or LESS, iirc. If that's overkill for you, you can just override paddings and margins if you write / load an extra admin.css. But the first thing you should consider, is to simply configure the admin theme via GUI @ site/backend/module/edit?name=AdminThemeUikit&collapse_info=1 And of course, PW lets you define borders, paddings, margins and background-colors on a per-field basis.1 point
-
News Update - 3 May 2019 - Part One The little speckled fella has been very busy on the trail. Despite being the smallest of its kind, she has lofty dreams. We've been working on the API and the Products GUI. In the next post, I'll tell you more about the API. Products Features and GUI Though there are a few issues still pending (aren't there always? sigh), I am relatively pleased with the results. Of course, during beta testing we'll received and incorporate feedback as best as we can. Only UI-Kit theme will be officially supported. Multilingual fields if site is multilingual Ajax powered inputs for fast and convenient editing Four types of products Physical product requiring shipping Physical product not requiring shipping (for collection) Digital product Service/Event (etc) products - e.g. Swimming lessons, Consultancy services, Hotel booking, etc Product Classification (ajax powered) by: Type: e.g. Belt, trousers, etc Brand: Puma, Sanyo, whatever (editors can type in or import brand names + planning to support logos) Categories (aka Collections): Multiple categories, e.g. Men, Girls, Hospitality Tags: Multiple tags can be entered, e.g. sale, amazing, etc Product Variants (consists of an Option (e.g. Colour) and an Option Value (e.g. Red) Add zero or n variants as you wish Live preview as you build variants Each created product variant can be enabled/disabled. Devs can then decide to either show that variant as unavailable or not show them at all. That's up to you :-). Apart from classifications, shipping class, inventory policy, weight and dimensions units, title and description (and this latter one may change), almost all product properties will vary by variant if variants are used Product properties include: Images Colour (more on this below) Downloads (centralised and reusable) Price and Compare Price (aka former price) Inventory policy (whether to track or not) Charge taxes SKU (stock keeping unit) Inventory (quantity) Allow back orders (aka overselling) - @note: this can be set per variant. This is useful if one variant can be restocked faster than others Weight Length Width Height Weight Unit (mg, g, kg, oz, lb, t) Dimensions Unit (mm, cm, m, in, ft ) Shipping Class - can be used for product-based shipping if needed (e.g. bulky goods, light, fragile, small items, perishable, etc) Images (more on this below) Downloads (more on this below) Images Multiple images can be added to both a product and its variants (in case its has some). Images add to the product itself can be used with all variants Images added to a variant are tracked/tagged as belonging to only that variant In some cases, it may not make much sense to add different images for similar variants. For instance, a small red hat and a large red hat could probably share the same images. Although we do not currently support specifying an already uploaded image as belonging to a group of variants, this may change in the future Colour Similar to images, can be set at both product and its variants level Colour saved in RGBA format Downloads Also similar to images, can be populated for both both product and/or its variants Multiple files can be added to a product A file designated for 'whole' product will be available to download irrespective which variant of the product was purchased Conversely, a file or files saved for a variant will only be available to the buyer if they buy that variant of the product The above is useful if you want buyers to be able to download different files of the same product. For instance, recently someone needed to sell two versions of a font as part of one product. This is a solution for such cases. TODO List Lots! e.g. default settings for some properties, e.g. weight unit, shop currency, etc. For the frontend, we are creating a rich language-aware API that you can use to build your shop however you want. There will be no rendering of markup (but see first post in this thread about a separate fully functional frontend shop). In the next post, we talk a bit about the API. Before that, here are some screenshots and a video demo (if you can spare some 20 minutes away from watching, er..., cat videos? ?) Screenshots Video Demo Thanks ?1 point
-
This module (github) does with site/assets/files what Ryan's DatabaseBackups module does with the database: Backup site/assets Download ZIP archive Upload ZIP archive Restore site/assets Motivation: This module can be the missing part for projects with content backup responsibility on the client's side: The client will be able to download DB and assets/files snapshots through the backend without filesystem access, thus backing up all content themselves. Release state alpha – do not use in production environments. Credits for the nice UI go to @ryan – I reused most of it and some other code from the DatabaseBackups module.1 point
-
Hi @MrSnoozles you are right - RockGrid is intended to load all data to the client at once. Doing this via paginated ajax calls would have a lot of side effects and is not planned. For example if you have column statistics showing the sum of all rows, that would not be possible when data was paginated (and not fully loaded into the grid). Also sorting would work totally different. aggrid supports this feature, but it would need a LOT more work to also support this in RockGrid. Not only for development of RockGrid but also for development of every single field/grid. When I have complex queries then I usually display only a subset of the data, for example all entries of year XXXX. You can see some performance tests here:1 point
-
Just added support for tippy.js to show nice tooltips with additional information. For example here I needed to show all available invoices related to one project of one month and I don't want different line heights, so I show the links on hover: Using tippy.js col = grid.getColDef('ids'); col.headerName = 'Rechnung'; col.cellRenderer = function(params) { if(!params.value) return ''; var ids = params.data.ids.split(','); var out = 'IDs: ' + ids.join(', '); var tippy = 'One per line:<br>' + ids.join('<br>'); return RockGrid.tippy(out, tippy); }1 point
-
1 point