Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2018 in all areas

  1. $roles->find('');// all roles //$roles->find($selector);// if want particular roles http://processwire.com/api/ref/roles/ Adapt as required for module use
    4 points
  2. At giving me an absolute headache! Sorry for the clickbait title, I just need some emotional support. Currently working on a website using WordPress as we needed eCommerce and their current platform is WordPress, didn't make sense to change them to a platform such as SnipCart that would take a percentage of their sales. WordPress is horrible! WooCommerce is horrible! ProcessWire things make sense, you only have to read the documentation for like a second and everything makes sense. WordPress, I'm sieving though WP_Query, the_post, the_loop, the_row, the_title. And stuff like getting an image size like $image['sizes']['large'] then in other cases you have to do $post->the_title() sometimes you do the_title(). Now I'm working with WooCommerce. the_type() returns "Simple" the_price() returns nothing, printing what $product is returning and everything is there. I'm going to pull my hair out. ??
    3 points
  3. I should also add that you can also do: so $roles does contain all the roles, it just doesn't return an array that can be dumped by default, which is different to $templates and $fields - this seems like a bit of an API inconsistency to me. Also to note, you can do:
    3 points
  4. I've added Tracy Editor integration, so if Tracy is installed and its File Editor feature is enabled you can click on a test name and the editor loads. @adrian It was not straightforward to integrate the editor, adding "tracy://?f=..." wasn't enough. I've pulled the corresponding script and then it started to work fine. However, currently the page reloads after save in the editor which is a drawback in this module. Is there a way to skip this? Perhaps adding an extra parameter to tracyFileEditorLoader.loadFileEditor? Or would it interfere with the editor's Backup feature? (I don't mind if it's not available in this case)
    3 points
  5. https://github.com/processwire/processwire-requests/issues/212
    3 points
  6. tracyFileEditorLoader was not available until the File Editor panel was not opened, so clicking on an edit link (outside of any Tracy panel) didn't do anything. Anyway, I'm fine with the current solution. An AJAX save would definitely solve the issue here but I don't know if there any users who would use this. I can live with the page reload, I think I would use the File Editor only to see what's happening or what went wrong, and edit the file in my IDE. So I would suggest leaving as it is until someone requests that.
    2 points
  7. Maybe just use: http://modules.processwire.com/modules/settings-factory/
    2 points
  8. Did you google the error msg?
    2 points
  9. Hi @sebastiaan and welcome to the forum. You could try this... $role_list = wire('pages')->find('template=role'); I also highly recommend installing the Selector Test module or the Tracy Debugger Module so you can explore using PW's selectors for this sort of thing.
    2 points
  10. I wouldn't call that a bug, but it would definitely improve API consistency ?
    2 points
  11. You can do it on 13 inch but it's a struggle constantly switching screens. So I got one of these and it's a brilliant addition for any Devs out there. https://www.packedpixels.com/ I took the opportunity to find out more about CPU / RAM Usage of Docker Containers and it looks like it can vary a lot. I was thinking more in terms how VMs are run with Docker, but that is not the case and it seems much smarter. It looks like with the new version of Docker, you can actually constraint it's CPU / Memory usage using flags/switches during startup if you find it's using too many resources. Filezilla / Chrome : They can be CPU/memory hogs and possibly your #1 user of CPU / RAM depending on # of tabs. I'm actually running Waterfox instead of Firefox for the extra performance without all the bloatware. And Chrome, I highly recommend OneTab and/or The Great Suspender extensions if you're a tab hoarder like I am. https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg?hl=en It's probably the best way to buy an Apple. 15% discount is not to be sniffed at. The last 2 laptops I owned were refurbs from Apple. The 1st one the graphics card died after 6 years but that model was notorious for gfx card issues and lucky it was cheap enough to replace. My last one I've had a few issues with in the last 6 months, but I was very lucky to find a very good deal at the refurb site at the time. And finally, I recommend backing up your laptop from day one. The excellent Time Machine backup software has saved the day plenty of times. You don't have to buy a Time Capsule for it. I think just any portable HDD will do. I can still remember unboxing my first Macbook like it was yesterday .... enjoy the experience and your new machine!
    2 points
  12. ProcessNetteTester Run Nette Tester tests within ProcessWire admin. (continued from here) Features AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) TracyDebugger File Editor integration https://modules.processwire.com/modules/process-nette-tester/ https://github.com/rolandtoth/ProcessNetteTester
    1 point
  13. I completely agree with everything everyone has said thus far regarding WP. If I "have" to do anything with wordpress, I use typerocket. The framework makes it a lot more enjoyable to work with (IMHO) and has repeaters as well.
    1 point
  14. It's WordPress... there must be a plugin for that!
    1 point
  15. Why? It is a very nice Plug&Pray platform. Oh well, yes, that is a skeleton in the cupboard. It is such a bad example of "simplifying" queries that even plugin developers are rolling out their replacements, eg: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/ or WooCommerce which nowadays is the same as Automattic: https://woocommerce.wordpress.com/2018/07/17/woocommerce-custom-product-tables-beta/ "This builds on the investment we made in 3.0 which introduced Data Stores and CRUD functionality that provides a uniform way of accessing a store’s data regardless of where it is saved." and even the core WordPress team: http://v2.wp-api.org/ Hordes of talented developers are trying the get rid of the underlying crap but all in different directions. It will be interesting to see how it will turn out... In the meantime, the main effort is to replace the back-end: https://wordpress.org/gutenberg/ However, I have not read anything about getting rid of all the other junk WordPress has in big quantities. BTW, WordPress is the winner in another area: http://blog.insight.sensiolabs.com/2014/11/04/technical-debt-relevant-projects.html
    1 point
  16. Hi @BFD Calendar I know it’s been a long time since you have reported your issue-almost one year. But I experienced the same issue on the same provider (OVH) and I found a solution. Maybe it can help: in my client interface my global PHP configuration was still set to "Legacy", I changed it to « stable » and I am now able to use the Processwire upgrade module. It can also be done in the .ovhconfig file by changing "container.image=legacy" to "container.image=stable".
    1 point
  17. thanks, dragan i should have set pdo_mysql.default_socket in php.ini
    1 point
  18. It actually only adds active to the active nav item. All parents of the active nav items get "parent". The first options in MSN. https://github.com/somatonic/MarkupSimpleNavigation#same-with-comments $options = array( 'parent_class' => 'parent', // overwrite class name for current parent levels
    1 point
  19. Hi @ak1001 , are you 100% sure the MySQL server address, port, username, password and DB name are correct?
    1 point
  20. The following hook should do what you want. It's based on old @Soma's post. All you have to is to edit $myslug with your random hash generator. $wire->addHookBefore("Pages::saveReady", function(HookEvent $event) { $page = $event->arguments[0]; if ($page->template->name != 'news-article') return; foreach ($this->languages as $lang) { $lname = $lang->isDefault() ? '' : $lang->id; $default = $this->languages->get("default"); $myslug = '-myslug'; if ($page->title->getLanguageValue($lang)) { $page->set("name$lname", $page->title->getLanguageValue($lang) . $myslug); } else { $page->set("name$lname", $page->title->getLanguageValue($default) . $myslug); } } });
    1 point
  21. Thanks netcarver! Coming from a Drupal background... If an issue has been fixed by the module maintainer, then he/she marks it with a status of "Fixed" see https://www.drupal.org/issue-queue/status#fixed. After two weeks the issue automatically changes to "Closed (Fixed)" see https://www.drupal.org/issue-queue/status#closed. Drupal's issue queues are different than Processwire's. On drupal.org, anybody can change an issue status at anytime. On github/processwire, only the issue creator or admins can the issue status. Although 200 open issues seems like a big number, check out https://www.drupal.org/project/drupal ? Although with Wordpress it's hard to tell what the number is https://core.trac.wordpress.org/tickets/latest
    1 point
  22. There are a number of screenshots in the blog post that introduced the inline editing. You can see multi-language fields in those. https://processwire.com/blog/posts/inline-ajax-page-editing-comes-to-listerpro-processwire-2.6.6/
    1 point
  23. Thanks for your reply and input, @rafaoski. That would be fine too, BUT I sadly encounter the following issues: '-myslug' in my simplified example is actually a random hash generator. If I unpublish the page and republish it, another string is attached to the already existing one (ex. my-article-my-slug-my-slug after the second publish. even when using the Pages::publishReady hook, the slug is only appended to the default language page name/url and not to other languages.
    1 point
  24. Yeah, I completely agree - it seems that VentureWeb always adds jQuery to their sites, but I rarely do. Let me check with them and see if they'd be willing to work with a non-jquery version. I have commit access to the Drupal version's repo, so if you or someone else would like to convert the PW version, I'd happily port those changes back to Drupal so things are easier going forward.
    1 point
  25. These look like false positives, especially given the last one (a CSS file served by Apache). What's happening here is that your server is taking a long time to respond to the requests, and the testing tool is making the assumption that because it responded slowly, it must have executed the command it sent (sleep and timeout). Most likely your server took a long time to respond to the request because that testing tool is hitting the server hard, and it's either struggling to keep up, or it's throttling the tool, limiting how many requests it'll respond to at once. It's also possible you've got another server-side security tool that is detecting something trying to mess with it, and interrupting the request. With a tool like ZAP, false positives can happen, so you should use it to find where to look, but use the information it gives you to confirm on your own whether it's an issue or not. And if you ever think you've found some security an issue in any software, contact the author directly, don't post it in a public forum. The only other thing I'd suggest is to look at your site template that serves the first URL it mentions, and check if you are using a GET variable named "query", and if so what you are doing with it. However, I think this is unlikely given that it's reporting the same error on a CSS file, which is served directly by Apache, not ProcessWire.
    1 point
  26. You can set flags and apply roles allowed to 'view' or 'edit' this field. $field->setRoles(string $type, $roles); // $type = 'edit' or 'view' $field->addFlag(int $flag); $field->removeFlag(int $flag); Reference: https://processwire.com/api/ref/field/ https://processwire.com/api/ref/field/set-roles/ https://processwire.com/api/ref/field/add-flag/ https://processwire.com/api/ref/field/remove-flag/
    1 point
  27. Everybody thanks for your input. I just bought a refurbished macbook pro 15" 2015 with 256Gb with 2 months of apple warranty left and 12 months warranty of the retailer. I got a new display and new accu (complete top casing) with 0 cycles. This should sufficient for the coming years. Will get it tomorrow with the postalservice. Looking forward to unpack it ?
    1 point
  28. I would go for it. As Ryan pointed out, sending a Mac to a repair shop can cost a lot of money and I think the "safest" Apple laptops these days are the end of the line 2015 models. Generally speaking, end of the line models always suffer from less factory issues than brand new designs (which is the case with the 2017 line).
    1 point
  29. I'm running on a 2013 macbook pro (15-inch) with 8gb ram and 256gb drive. I find it works well for PhpStorm and other web development tools. I don't have photoshop or docker, so can't say about those. It's the most reliable computer I've ever used, and it runs just as well as the day I bought it (not feeling any need to upgrade anytime soon). I do occasionally wish I had 16gb ram, but I don't think I actually need it. This is essentially what I've got, though mine is a couple years older and has half the ram. If you aren't moving your computer to different locations every day, the 15-inch screen is a lot more real estate than the 13-inch, which is useful when it comes to web dev. The 15-inch screen is a big difference to me, and something I can work off of all day. The 13 inch would probably be more challenging, especially in apps like PhpStorm or Photoshop. However, my eyes aren't great. Other things to mention about the 15-inch: It has a 4-core processor, vs 2-core on the 13-inch. But I'm not sure if it makes any difference for the applications you've mentioned. The 2015 model I think is using the older style keyboard (?) which would be a benefit, because it's a lot more reliable from what I understand. Then again, it is used, so who knows. Markets are different depending on location, but the price of the one you mentioned seems high to me, given that it is used. $1275 EUR is about $1500 USD, which is what I paid for my 15-inch MBP brand new. Though when I bought it, it was "last year's model", so the price had come down. But if you are considering the 15-inch, I would look around to see if there are others you could get for less and perhaps be able to negotiate the price down. Notebook computers are much more likely to break than desktop computers, and much more expensive to fix when they do. So a warranty carries a lot of value, and likewise a lack of a warranty should reduce a lot of value. For this reason, I would usually say to buy notebook computers new or refurb (from Apple) if you can, and get as old of a model as possible, that still carries the full warranty. If you buy used, then factor in the risk of something breaking, and on an Apple notebook that could be a $500 repair or more. In fairness, I've had about 5 Apple notebooks over my life, and only 1 of them has had any issues.
    1 point
  30. Hello, I recently posted in this topic, but I decided to start my own thread because while I believe my issue is related to the one in that thread, they are not exactly the same: I have created a custom User Template in the method outlined in the docs. I am creating a directory, so it made sense that every page in the directory was a Directory Member, so they could log in and edit their own information while also keeping the entire directory protected behind a login wall. So the new user type is created: "directory-member". I then created two new roles: "member" and "directory-admin": The "member" only has the ability to View directory-member pages, and "profile-edit", which allows them to manage their own information. The "directory-admin" has the ability to edit any directory-member pages, and administer users. Some Directory Members are both, but all have at least the "member" role. The first hint that something was wrong was when I was testing a "member" user and I could not add a new item to a repeater on that profile. The url for the profile edit (this will be important shortly) is site.dev/admin/profile. The repeater is set up to load new items through AJAX. If this option is turned off, the rest of this issue is no longer completely valid. But as I have found what I believe to be a pretty large issue in the Processwire codebase, I thought it worth bringing up. See, every page (even a user) has a $page->editUrl() method, and it returns a URL like this: site.dev/admin/access/users/edit/?id=2096. That's all good and fine for users that have page-edit permissions, but if they don't, that link will resolve to the admin's equivalent of a 404. So the way that Processwire currently gets around this is by creating a specific editing area for a user to interact with only their profile: /admin/profile. And that works pretty nicely, except for the fact that nowhere is editUrl() ever made aware of the difference. editUrl() is not hookable, and whether or not a page is editable is based on the PagePermissions module. On top of that, there are several core modules that hardcode a search-and-replace (see InputfieldRepeater.module:627) where the editing screen is for Users. This doesn't allow for a huge degree of flexibility that is offered in other places throughout Processwire. If line 627 of InputfieldRepeater is changed from this: $editorUrl = str_replace('/access/users/edit/', '/page/edit/', $editorUrl); to this: $editorUrl = str_replace('/access/users/edit/', '/profile/', $editorUrl); ...the AJAX repeaters work. It's maddening! As is brought up in the thread I attached above, a lot of the features of page editing are missing within /admin/profile/, and it just makes for an altogether strange editing experience. A user who has "page-edit" permissions for templates other than directory-member, but does have "profile-edit" permissions, will see their user in the Page List, but cannot edit their Page unless they hover over the wrench and click the "Profile" link. It just seems - off. I think what this hinges on for me is that the editUrl() of the user should be "/admin/profile/" if that user is logged in (and their page should be editable from the Page List), or the "/admin/access/users/edit/" url; regardless of the URL, both links should resolve to the Page Edit screen, as the Profile Edit screen seems to be a unnecessarily neutered version of Page Edit.
    1 point
  31. I submitted an issue report: https://github.com/processwire/processwire-issues/issues/552 If you think, this should be fixed, please leave a comment on github. Thank you. I did not file this as a feature request because I consider it a bug. One would expect to display tabs as tabs and not as fieldsets. No matter whether in page edit or profile edit screen.
    1 point
  32. I know this is an old topic, but I am currently running into some majorly-headache-inducing issues concerning the User Profile Page and the Page Edit screen - I can't sort out why they have to be different. I am about to post a new thread about my specific experience in this realm, but if anyone knows anything about this issue, I'd appreciate the help! Here's the thread I just created--
    1 point
  33. And last some code when children would have their own template: $allChildren = $pages->get("/locations/")->find("template=child_tpl"); or even checking for parent template $allChildren = $pages->get("/locations/")->find("parent.template=parent_tpl"); or $allChild = new PageArray(); foreach($pages->get("/locations/")->children() as $parent) { foreach($parent->children() as $child) $allChildren->add($child); } and there's even more variations depending on who writes it.
    1 point
  34. Hm, if I understand you correctly there is still not a way to do it as you imagined it. I'm assuming you want the ability for the editor to add groups of fields in the page admin and fill them directly there, a bit as having repeaters with individual templates (this was discussed before somewhere). You can go with Martijn's solution. Hanna code works very well. Or you can do the same directly in the page tree. --page two ----block one (template=text) ----block two (template=accordion) --page two ----block one (template=text) ----block two (template=images) ----block three (template=text) The editor would create a new page in the tree, and those block as children of it. To choose what kind of block, they would choose the template while creating it (you can limit the templates selectable for pages of this kind). To output it on the parent page template: foreach($page->children as $c){ echo $c->render(); }
    1 point
×
×
  • Create New...