Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/02/2017 in all areas

  1. Happy New Year to everyone! For a project that I'm working on, I needed to have dependent checkboxes on page edit forms in the admin. Just like dependent selects but for checkboxes. I couln't find anything and decided to write my first Inputfield module. I have only tried it on PW > 3.0. But it should also work on the 2.x branch. Would be great if some of you could try it out and give some feedback. You can find the module InputfieldDependentCheckboxes at github Here's some screenshots of the module in action and instructions on how to use it. ##An Inputfield for ProcessWire admin interface that handles the display of dependent checkboxes in page fields Sometimes we need checkboxes to depend on other checkboxes in our page edit forms. This module adds this functionality to standard page field checkboxes for 2 or more checkbox fields. ## Installation 1. Copy all of the files for this module into /site/modules/InputfieldDependentCheckboxes/ 2. In your admin, go to the Modules screen and click "Refresh". Under the 'Inputfield' section, install the 'InputfieldDependentCheckboxes' module. 3. Open Modules->Configure->InputfieldPage. Under 'Inputfield modules available for page selection' add 'DependentCheckboxes' from the select dropdown and submit ##Field Setup This inputfield extends the standard checkboxes for page fields. Therefore you need to have page fields configured already that you can extend with this Inputfield type. ###Prerequisites You need to have at least 2 fields of type page that have 'Checkboxes' defined as Input field type and live on the same template. A real world example: There are different types of instructors. Each instructor type can have multiple different certifications. For this to happen, we need 2 page fields (multiple): A) instructor_types: lists pages with template 'instructor_type' B) certifications: lists pages with template 'certification' The certification template needs to have the instructor_types page field to assign one or more instructor_types to a certification. ###Setup (link checkbox fields) 1. Edit your page field A and go to the 'Input' Tab. Under 'Input field type' choose 'DependentCheckboxes'. Hit save. Now under 'Choose the target checkboxes field' choose the name of your field B. Hit save again. 2. In your page field b make sure to choose a template under 'Input' Tab under 'Selectable Pages'->'Template of selectable page(s)'. Your fields should be setup. If you now edit a page that contains the 2 fields, the dependent checkboxes should be working. EDIT: And yes, this is working for multiple dependent checkboxes, too. (I have tried it with 3 so far) Some notes on how the module works behind the scenes: - parent checkboxes (actors) that have dependent checkboxes (targets) get custom data attributes applied which contain arrays of the targets' IDs - some Javascript is initiated on acxtors and targets to handle the display based on the id arrays in the data attributes. EDIT: since this module's mention in ProcessWire Weekly it might get some more attention. I just wanted to point out that it is still in alpha state. I will continue development and more thorough testing while implementing it in an ongoing project within the next 3-5 months or so. I will eventually release a stable version then. If you use the module with only 2 dependent checkbox fields, it should work smoothly. There are still some quirks when using 3 or more and I need to figure out how to best resolve them. So please be patient (or jump in with ideas ).
    13 points
  2. Hi everyone, I have committed a new version that takes care of @Ivan Gretsky's issues with guest access for calling actions via the API. The new version also includes the ability to add actions to the Setup > Admin Actions submenu which could be really handy for quick access to key actions that you use regularly. At the moment you could add them all if you want, but perhaps in the future we'll have too many to make this usable, which is why I have made these configurable. See the new "In Menu" column:
    5 points
  3. Probably something to do with the php garbage collection. Check this out: 1, 2.
    5 points
  4. One of the greatest Finnish inventions, IRC, is still evolving. It even has a working group pushing things forward. I thought I would create a topic with curated open source tools to maybe inspire more people to join #processwire @ Freenode network. I have selected the tools on the basis that they seemed to be under active development. Awesome IRC is a nice list, but too detailed for this context and listing many unmaintained projects. Desktop clients (cross-platform) HexChat Irssi KVIrc Quassel (has the unique feature that one (or multiple) client(s) can attach to and detach from a central core) WeeChat Multi-protocol Swiss army knives Pidgin Smuxi Thunderbird Android clients HoloIRC qicr iOS clients Mutter Colloquy Web-based clients These should be quite interesting to the PW crowd as hosting web applications is your bread and butter Glowing Bear (web frontend for WeeChat) Kiwi IRC (currently being rewritten) The Lounge Quassel webserver Bouncers (don't lose chat history even though going offline) Firrre - get a free bouncer for free & open source community networks. See the guidelines: you need a 60-day old registered NickServ account and a Github.com account. See the Freenode guide to nickname registration. ircb ZNC
    4 points
  5. I never bother with individual mod_security rules. I just disable it: <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> You should be quite safe with the ProcessWire defaults. BTW, you should also add Options -Indexes to .htaccess to disable dir listing.
    3 points
  6. I am assuming by post you are referring to the $child? What is not clear is whether you want the title of the parent of the current page or the title of the parent of $child. Anyway, here's some code. // will give you the title of the parent of the current page // @note: if on 'home' page, will return nothing since 'home' does not have a parent $page->parent->title; // will give you title of the parent of $child // @note: since you are in loop, this will be repeated for each $child // but you already know the parent. It is 'recommendations'...so, @see alternative code below $child->parent->title; /** alternative code **/ // get the parent page $r = $pages->get('/path/to/recommendations/'); $out = '';// empty variable that we will populate with final output if($r && $r->id && $r->numChildren) {// checks if we found a valid page and it has children $out .= $r->title;// @note: about the .= read up on PHP concatenation (we are adding to the previous value we found here, rather than using multiple echos) foreach ($r->children as $child) { $out .= $child->title; $out .= '<img src="' . $child->Image->first()->size(200,0)->url '">'; } } // output echo $out; Also note, ideally, you want to name your fields all lowercase, i.e. 'image' rather than 'Image'.
    3 points
  7. If you're using mod_security I'd suggest looking into disabling it. There are various topics here in the forums, where mod_security was causing all kinds of troubles when running processwire.
    2 points
  8. Hello, I disabled Mod_Security and it resolved the issue so I have passed this onto the hosting company as Its a bit over my head! This is what Mod_security seems to be picking up [Mon Jan 02 14:38:14.099831 2017] [:error] [pid 17088] [client 86.183.53.136] ModSecurity: Access denied with redirection to http://rossofmullbunkhouse.co.uk/ using status 302 (phase 2). Pattern match "(?i:(?:,.*?[)\\\\da-f\\"'`][\\"'`](?:[\\"'`].*?[\\"'`]|\\\\Z|[^\\"'`]+))|(?:\\\\Wselect.+\\\\W*?from)|((?:select|create|rename|truncate|load|alter|delete|update|insert|desc)\\\\s*?\\\\(\\\\s*?space\\\\s*?\\\\())" at REQUEST_COOKIES:InputfieldImage. [file "/etc/apache2/conf.d/modsec_vendor_configs/OWASP/rules/REQUEST-42-APPLICATION-ATTACK-SQLI.conf"] [line "82"] [id "981257"] [rev "2"] [msg "Detects MySQL comment-/space-obfuscated injections and backtick termination"] [data "Matched Data: ,\\x22listSize\\x22:23, found within REQUEST_COOKIES:InputfieldImage: JSON{\\x22header_image\\x22:{\\x22size\\x22:130,\\x22listSize\\x22:23,\\x22mode\\x22:\\x22left\\x22},\\x22images\\x22:{\\x22size\\x22:130,\\x22listSize\\x22:23,\\x22mode\\x22:\\x22grid\\x22}}"] [severity "CRITICAL"] [ver "OWASP_CRS/3.0.0"] [maturity "9"] [accuracy "8"] [tag "Host: rossofmullbunkhouse.co.uk"] [tag "application-multi"] [tag "language-mutli"] [tag "platform-multi"] [tag "attack [hostname "rossofmullbunkhouse.co.uk"] [uri "/pw/site-manager/page/edit/"] [unique_id "WGpl1oBzb5WYMc2t5l7ddQAAAA0"] Cheers Jon
    2 points
  9. Yeah, I'm using the good ol TemplateTwigReplace.
    2 points
  10. Ok. I think there should not be any issues with the search even though I did not have much time playing with PW even though I planned to. Instead of giving explanations, I will just copy/paste the simple search code with some comments in it to help me and everyone else the logic: I am certain that this would make the search results showing properly, however looking back at the code of the skyscrapers I have found the logic behind the delayed output so I think it might be the perfect timing for me to work a bit on the existing theme files and redo them as per that. I had difficulty understanding the calls and what was the full logic of it, however, I found out that every template defines the content of $content or $body (just variables that can be named anything) so the main template is showing just $content/$body instead of the full logic of the specific template. I might do the simple search first and then start improving the site so will see but what is more important is that the code above makes perfect sense and represents the easy implementation I was so afraid of messing up. Once I finish with the code, I will post the search.php in case someone would need to review it. As far as my example is of a premium theme, I am not sure of the consequences posting the code in here, so I will have a look to another free bootstrap theme that would have most (if not more) of the functionality already discussed and will post the files/theme once done. If you happen to like the premium theme and want to turn it into a project, I will do my best to share the needed pieces of the code to achieve that so that you would already have the rest
    2 points
  11. Hi all, My 1st submission here - MeBilling.com - A website for a medical billing solution provider. What I did in this: Logo, Website Design, Processwire integration Processwire modules used: Mostly utilised core 3.0.x modules, with Frontend editing feature for ease of content editors. Let the opinions flow in.
    1 point
  12. In case anyone is interested in using IRC to chat about ProcessWire, and having consulted with Ryan about it, I have registered #processwire on irc.freenode.net for that purpose. If you are a regular on freenode, just pop into #processwire. If you are not then the fastest way to get online is probably via the webchat interface at http://webchat.freenode.net/?channels=processwire&uio=d4 Hope to meet a few of you in there sometime.
    1 point
  13. Since some others and me have been run into problems with FieldtypeFloat. I want to start a discussion with the purpose to get a consistent FieldtypeFloat and/or to create a new Fieldtype maybe called FieldtypeDecimal to store exact values maybe for currencies. First I will assume some known problems. precision Values of Type Float are stored in most of the Mysql Installations with a precision of 6 by default. PW FieldtypeFloat uses Type float() in the Mysql Database This could cause some problems. For easy understanding look at this table. +---------------+----------------+--------------------------------------------------+ | input | float() | decimal(10,2) | +---------------+----------------+--------------------------------------------------+ | 1234.56 | 1234.56 | 1234.56 | +---------------+----------------+--------------------------------------------------+ | 123456.78 | 123457 | 123456.78 | +---------------+----------------+--------------------------------------------------+ | 12345678 | 12345600 | 12345678.00 | +---------------+----------------+--------------------------------------------------+ | 1.23456789 | 1.23457 | 1.23 | +---------------+----------------+--------------------------------------------------+ | 12345678912345| 12345600000000 | ERROR SQLSTATE[22003]: Numeric value out of range| +---------------+----------------+--------------------------------------------------+ As an example in Apeisas Shoppingcart Module exists a field sc_price of type float(). This field allows a maximum value of 9999.99 Euro Dollar or whatever. Don't use it to sell cars like Ferrari. Try to store the input values of the preceding table in a PW Field of Type Float in your surrounding and look what you get after saving. Threads treating the same problem https://processwire.com/talk/topic/3888-float-field-rounding-problem/ https://processwire.com/talk/topic/86-float-field-rounding rounding Mysql will round anyway the float value to precision. So it is not necessary to round the value in php before storing. To store exact Values it is better to use Type decimal(M,D) where M is the lenght and D the number of digits. Thread treating the same problem https://processwire.com/talk/topic/86-float-field-rounding format We had already some discussion about local settings, storing and output of PHP-Values of Type (float). And Ryan did some Adjustments with number_format. But I don't trust completely, thats why I am using Textfields to store numbers. Would be nice to have a consistent Fieldtype working in different local-settings. Thread treating the same problem https://processwire.com/talk/topic/4123-decimal-point-changed-to-in-base-of-setlocale/ https://processwire.com/talk/topic/86-float-field-rounding What is a float (floating point value), what is decimal? A float is an approximate value and exactly like this it is stored in Mysql. For more understanding two examples. 1. example CREATE TABLE `test` ( `test_float` float(10,2) NOT NULL, `test_decimal` decimal(10,2) NOT NULL ); INSERT INTO `test` (`test_float`, `test_decimal`) VALUES (5.43, 5.43); SELECT (test_float * 1.0000000) AS f, (test_decimal * 1.0000000) AS d FROM test; This will result the following: f = 5.4299998 and d = 5.430000000 source: http://netzgewe.be/2012/03/mysql-und-waehrungsbetraege-float-vs-decimal/ (german) 2. example mysql> create table numbers (a decimal(10,2), b float); mysql> insert into numbers values (100, 100); mysql> select @a := (a/3), @b := (b/3), @a * 3, @b * 3 from numbers \G *************************** 1. row *************************** @a := (a/3): 33.333333333 @b := (b/3): 33.333333333333 @a + @a + @a: 99.999999999000000000000000000000 @b + @b + @b: 100 source: http://stackoverflow.com/questions/5150274/difference-between-float-and-decimal-data-type INFO & LEARNING http://stackoverflow.com/questions/5150274/difference-between-float-and-decimal-data-type http://stackoverflow.com/questions/4520620/float-precision-problem-in-mysql http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html INTENTION The intention of this thread is to discuss good solutions for a consistent working FieldtypeFloat which makes clear to Everybody what it is via description. Furthermore to build a new Fieldtype with setting options of total lenght and decimal places. NOTES Please use this thread rather for development than as a help forum. BTW I am not an expert in Mysql PHP or whatever. Maybe there are some guys in the forum which could put the real good stuff here. Thanks a lot and lets go.
    1 point
  14. Those are helpful links. It appears it is not something processwire is doing so much, it just changed the default location for what php already does. I would guess the files are necessary for allowing php to save session variables and deleting them would be bad. If so, I would want those to last 24 hours and do not think it would be a good idea to shorten their lifespan. If it were a garbage collection issue, I would think they would be not clearing out everyday. I think websites with a lot of traffic may benefit from having them saved in the database though to save inodes. Even downloading your website via ftp would be a hassle with it this way. It is easy to get around by compressing the website and downloading that file though.
    1 point
  15. You made my day Adrian !!! Working perfectly !!! Thanks very much.
    1 point
  16. Hello Guys, Thanks for the help I disable mod_security on the account & development site and that has resolved the issue! Confusing as I haven't had it before! Thanks for the Options -indexes tip Cheers Guys
    1 point
  17. Thank you @adrian! It is amazing to watch something being created with such an amazing pace by people like you and ryan. And so much to learn from. I recommend everybody to go through these guys' code to learn how you can be really powerful using ProcessWire. Another little idea. Not sure it is necessary, but seems logical to me to separate "core" actions and those specific to the site. Like core ans site modules. I can see this module to be a base to easily create little things that would other way need their own process modules. In that case, most of the time I would use only custom actions... A filter option or a tab. What do you think? I know, that for everybody but admin I can achieve about the same with by-action role assignment. But as I almost always login a superuser myself...
    1 point
  18. As I see it's used only when the page has no settings tab, which is not my case. I've tried changing the title using API but it didn't work.
    1 point
  19. Could there be a mention of the IRC channel on the PW website? Maybe in the footer and also somewhere else.
    1 point
  20. I've never had a blog before - and it's about time I had one now: blog.rockett.pw Introductory post: https://blog.rockett.pw/posts/first ?
    1 point
  21. It will soon click and it is code you can reuse . Btw, I added a note on concatenation in my code above.
    1 point
  22. Perhaps I misunderstood but what if you put it outside of the foreach loop so it gets output only once? <?php echo $page->parent->title;?> <?php foreach($pages->find("parent=recommendations") as $child) { ?> <?php echo $child->title;?> <img src="<?php echo $child->Image->first()->size(200,0)->url;?>"> <?php } ?>
    1 point
  23. I am glad to present our recent website. It was made, of course, with Processwire and this is the first time we use this CMS in our company. The website (in French only) is aimed to gather ski results from four youth ski clubs (our clients). The administrators needed something easy to use and be able to import XML ski results after a race. Those results are divided between ages (four categories, girls and boys), each ski category having its own rules for distribute points and ranking. The administrators wanted also a place where representatives of each club could post photos (elite team only). Processwire was the perfect candidate for this site which is fully mobile. Race calendar and results (click on this archived season to see the whole process since the present season has not yet begun as the writing of this post.) Annual ranking Documents (use of hanna code to place and identify type of document) Photo albums Elite clubs
    1 point
  24. That's the InputfieldWrapper / Form, but the input element / label is hardcoded. https://github.com/processwire/processwire-requests/issues/66
    1 point
  25. Yes, that's true that you can't use $page inside a function, but the other thing here is that you already have wire('page') - there is no need to get the page from pages again, so this should be fine: $this->set('successMessage', '<h2 class="enviado-ok">' . wire('page')->mensaje_form_enviado .'</h2>');
    1 point
  26. Just stopping by to wish all the other members a happy Christmas. Or if you don't celebrate Christmas, then a happy holidays! And if you don't have a holiday, maybe you'll get one next year :-p Been working on two websites concurrently with PW so pretty busy! Not been able to stop by here as much as I would have liked. On a plus note, both are now at the demo stage. I actually need to find some work in the new year as I'm kicking off my self employment again, so anyone wants to see the demo sites to see the kind of stuff I'm doing, then I'm happy to share in a PM. TBH, they're not highly technical, still more brochure style at the moment, but looking to move onto bigger and better things. Maybe a meetup in Surrey or something would help kickstart things a little. Have a good one people Sam.
    1 point
  27. Hi @Ivan Gretsky - ok, a new version has been committed that adds a new module config setting for determining whether database backups will be automatic, optional, or disabled. 1) Automatic - database backup will happen without user intervention. 2) Optional - adds a new checkbox at the bottom of every action's "options" form before the user clicks "Execute Action". 3) Disabled - this means no database backup will occur. If you do want to do a backup when calling an action via the API, simply add a new item to the options array: 'dbBackup' => true I am still working on figuring out the best approach for guest access. The biggest problem I see is that adding the "admin-actions" permission to the guest role means that any logged in user can now see the Setup > Admin Actions menu, even though they don't have permission to view or execute any of the actions. I have been playing around with adding a new helper module to handle the API calls, rather than calling the main ProcessAdminActions module directly, but there are a couple of inheritance issues I am not thrilled about, so looking into other options. Will hopefully have a good solution soon. Please let me know if the backup side of things handles your needs on that front.
    1 point
  28. That's why I play with a simple self created flex based grid / framework at the moment. Just for fun, but maybe I'll use it in the future flex grid (auto row wrap) nice buttons (based on button or a elements) checkboxes / radios with font awesome icons or css styled boxes and a slide toggle checkbox optional responsive table (html table change display mode (theader values in pseudo element ::before prefix the cell value) responsive dropdown / dropline responsive menu (styled checkbox toggle for mobile) I compare it with pure, but try to keep it more flexible and smaller. Helper classes aren't included, but I could add some in a optional file. So it's modular and small.
    1 point
  29. A few more updates to mention. 1) Tracy now correctly reports warnings/notices coming from PW's file/image AJAX uploads For those following the thread on CustomUploadNames and on Github, not only did Ryan make some changes in the PW core to make this work, but David Grudl over at Nette also added a workaround that now allows Tracy to report errors from vanilla JS ajax calls, even if they don't call xhr.getAllResponseHeaders(); which should help with debugging your own vanilla js ajax calls as well. 2) Easy toggle for Strict Mode Not sure how many of you have played with the Strict Mode config setting. It turns notices and warnings into errors and shows a full expandable stack trace. For example, here is the above notice in Strict Mode. Clicking on the "source" and "arguments" on the entries further down the call stack can be very helpful! This is great, especially for AJAX notices/warnings which are often harder to dig into. The catch has always been that Strict Mode will halt your scripts for these notices/warnings, which can often be painful when you are early into something complex and just want to get it working before dealing with these. Now on the Panel Selector panel the new toggle button makes it easy to turn on Strict Mode when needed (note this is only available if Strict Mode is off in the module config settings): 3) Time and memory of Console Panel code I recently added time and memory of the code run in the console panel. Note the 11.59ms and 0.07MB at the bottom of the output. This could be very handy if you want to test the performance of different selectors or loops. Hope you guys find these new additions useful!
    1 point
  30. Thanks, @owzim - perhaps an RSS feed? Do people even use RSS anymore? Edit: Have gone ahead.
    1 point
  31. We did discuss a UK meetup some considerable time ago. (Wow, 2012, not far off 5 years ago!) There were probably only half a dozen UK based active forum participants back then, and it's something I would be happy to revisit.
    1 point
  32. What Robin S said. Security How does the widget communicate with the third-party server? Is that something in your control? Are there risks if the communication was intercepted? User-Friendliness As a general rule, I would never put any sort of code in front of editors, unless I have to. Edit 10 or 15 pages and one widget starts to look like another, we miss or add an extra apostrophe here and there, and soon, it gets a bit messy and our code trips. In addition, the editors will probably be copying and pasting and that's somewhat tedious. Other than that, it doesn't look too friendly . OK, we can mitigate this by asking the client to enter something like this in the text/textarea field type:class_lists,partner:mb,id:123456WB,version:0.1 OK, a bit of progress, but that's still a bit cryptic for some clients. The ideal situation would be to create one input per editable-value. That would mean 1 field per editable-value. Maybe an overkill (to some). Better yet, I would create a custom field that will hold all those n number of inputs for n number of editable-values. The advantages of this are: It is user-friendly It is easy to sanitize and validate each individual input If needed, we can query each of those fields (e.g. in case we have lots of pages and need to find those that contain xxxx in their ID in order to edit them) Etc... Below is an example custom widget field as per above. It is not very difficult (if you are a developer) to create one based on the Events Fieldtype. Just my 2p. Something to consider.
    1 point
  33. hi jmartsch, you can use the modal directly. see here for docs: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Jquery/JqueryUI/modal.js#L10-L44 then you can do something like this: <a href="/admin/page/edit/?id=1246&fields=title,user_image,facebook_url,description" class="pw-modal" data-buttons="#submit_save" data-autoclose>test modal</a> <script type="text/javascript"> $('a').on('pw-modal-closed', function() { $('body').prepend('<div id="reload" style="width: 100%; height: 100%; position: fixed; z-index:9999; background-color: rgba(255,255,255,0.5); display: none;"></div>'); $('#reload').fadeIn(); location.reload(); }); </script> now you just have to make sure that all the necessary files get loaded by having <edit title></edit> anywhere in your html markup!
    1 point
  34. aahh irc - the days of mIRC, wild channels and coding cowboys ---
    1 point
  35. I'm giving out an implementation which you can use while Ryan is considering this matter. It's based on Ryan's FieldtypeFloat and InputfieldFloat and it should cover all the basics. cd <pw_modules_directory> git clone https://github.com/sforsman/FieldtypeDecimal.git git clone https://github.com/sforsman/InputfieldDecimal.git To actually use them, you obviously need to tell PW to scan for new modules and then install them. Couple of notes Since the precision needs to be defined on the database-level, this module hooks ProcessField::fieldSaved and updates the database if you have changed the precision settings. You get a notification if it's been done. Be aware, if you decrease the precision you will obviously loose those decimals forever after the save - the database is immediteally and always modified. I don't consider this ugly because this is mandatory - one way or another. Due to the implementation of the DECIMAL type in MySQL, it's not possible to choose such default values that would be optimal for all of the different scenarios. Along with a dot, I prefer to accept decimals with a comma as well. This is because many humans separate them with a comma. As with InputfieldFloat, you can define the range of the values the InputfieldDecimal will accept. If you have a precision math library installed, the module will use it when doing the comparison. This will rarely make a difference but hey, what the heck. To be consistent as to how the DECIMAL type is created in MySQL, the digits-parameter refers to the the total number of digits - including the decimal parts (5.55 has three digits and two decimals). There's a few known "issues" (I prefer to call them "features", though)The min/max configuration Inputfields are still using InputfieldFloat. This means you need to separate decimals in your min/max range with a dot. The sanitizer currently uses is_numeric() to check the value, which means you can enter some weird stuff (like 0x539) and it's sent to the database. However MySQL obviously ignores such values and stores 0 for you. This should be improved later. The Fieldtype doesn't do much to the values and relies on MySQL to handle the necessary rounding etc. This is good in my opinion. However this also means that if you have set the precision to "2" and enter a value that doesn't have any decimals (e.g. "5"), MySQL will add the decimals (the DECIMAL type is afterall an exact fixed-point type) and that's what you will see after you have saved your value (e.g. "5.00") . Again, I consider this a good thing. Like InputfieldFloat, the InputfieldDecimal doesn't do any validation on the data - invalid values are just blanked. As I have intentionally hooked only ProcessField::fieldSaved, you need to manually either a) call $field->type->syncSchema() or b) hook Fields::save yourself if you are modifying the precision of a field through the API. Oh and I'm open to any ideas - at least regarding these modules.
    1 point
  36. I started a new topic here: https://processwire.com/talk/topic/7542-development-fieldtypefloat-fieldtypedecimal/
    1 point
  37. I believe this issue is specifically for Debian servers. I found an old article that explains why this behavior occurs on Debian machines: http://oscarm.org/2006/09/debian-php5-and-session-garbage-collection/ The above article still seems to be relevant, even though it seems to be marked as solved in the Debian bug system (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=388808) I moved my sites from a Centos machine to a Debian in April and under that time the number of session files has been growing. I post this as a heads up for others running ProcessWire on Debian. //Jasper
    1 point
  38. Thanks for the Flourish suggestion - I did recently see something about it, but hadn't investigated yet - looks like it could come in quite handy. I know it's been said before, but the community on this forum really is about the best I've ever experienced. I am looking forward to being able to give something back very soon.
    1 point
  39. Coming back with the all time favorite of me, appending scripts. If I create a new js module, it gets appended before the jquery core scripts at first position. How can I add scripts after, or at certain position? <?php class MyJSModule extends ModuleJS { public static function getModuleInfo() { return array( 'title' => 'MyJSModule', 'version' => 1, 'summary' => 'test', 'href' => '', 'autoload' => true ); } public function init(){ parent::init(); } // note ModuleJS automatically loads any JS or CSS files with the same basename as this module } And the output is this: <script type='text/javascript' src='/site/modules/MyJSModule/MyJSModule.js?v=1'></script> <script type='text/javascript' src='/wire/modules/Jquery/JqueryCore/JqueryCore.js?v=162'></script> <script type='text/javascript' src='/wire/modules/Jquery/JqueryUI/JqueryUI.js?v=180'></script> <script type='text/javascript' src='/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.js?v=102'></script> ...
    1 point
  40. Ah my colorpicker example isn't what I thought.. I decided to leave colorpicker js files in a subfolder as is. Sorry for the false example. But it really confused me in other modules I've done for sure. Just spoted something I didn't knew, thanks Ryan
    1 point
  41. OH. MY. GOD. Tell me I'm not dreaming! I've been scouring the Internet for weeks looking for a CMS that would allow me to give my clients a decent user experience. I've developed sites in Joomla, Drupal, Silverstripe, and Wordpress. Joomla was a nightmare of epic proportions. The admin interface is confusing and inconsistent. Drupal had promise in theory, but trying to customize it just caused it to bug out. Silverstripe is nice, but the admin panel is slow and clunky. Wordpress is great for blogs, but feels like you're hacking it if you're trying to use it for more than that. After my frustrations with the big name CMSs, I decided to try and get a better lay of the land and see what else was out there. Every one of them was either lacking a crucial feature, poor on the usability front, or a buggy mess. I have some programming knowledge, but mainly I am a designer looking for a CMS that lets me design the client's experience in the same way that I'm able to design the end user's experience. I don't need templates or templating languages. I want something that lets me be the designer and then gives my clients the power to work with what I've developed. As someone deeply concerned about user experience, I don't understand it. How could so many developers get this so wrong? Were they just throwing these things together without thinking about the use cases? The need for flexibility? What people actually NEED in a CMS? I was beginning to think I'd have to become a PHP developer and build something from scratch. So far, what I see in ProcessWire is almost exactly the ideal CMS I have been piecing together in my mind's eye. The consistency in the mental design model, the absolutely crucial ability to create your own page types and custom fields for your clients which is utterly lacking or nonexistant in nearly every major CMS, the ability for logged in users to easily update a page they're on by simply hitting an "edit" link from the front end... Elegant, logical, and flexible. It's obvious that you've put a lot of thought into this. Thank you. I can't wait to get started.
    1 point
×
×
  • Create New...