Jump to content

Kiwi Chris

Members
  • Content Count

    79
  • Joined

  • Last visited

  • Days Won

    1

Kiwi Chris last won the day on November 13 2017

Kiwi Chris had the most liked content!

Community Reputation

143 Excellent

About Kiwi Chris

  • Rank
    Full Member

Profile Information

  • Location
    New Zealand

Recent Profile Visitors

914 profile views
  1. Conditionally 2, provided the collapsible option is available. One of the things I like about Processwire is that it plays nice with mobile screens. Some other CMSs are clearly designed for desktops or large tablets only, but Processwire will work even on a smartphone. I can't say how often I'd actually use it on a phone, but it would be nice to have the option. I actually can think of a case where having the backend mobile friendly would be handy. I was at a market last year, and someone didn't have any cash, but did have a credit card. Of course the front end of my site is mobile friendly anyway, but it could be handy to have the backend mobile friendly too.
  2. If for any reason, you can't get terminal access, you can add the php code to any template that already exists in the /site/templates directory and then view any page based on the template to trigger it. You won't require the first require line in that case, and don't forget to remove the password reset code again afterwards.
  3. Beat me to it. It's one of the nice things about Processwire that the admin is simply a UI on top of the API, and anything you can do via admin, you can also do easily via a script.
  4. I'm trying this option, but I can't seem to get it to work. I've tried: public function ready() { $this->addHookAfter('Page::render', $this, 'updatePageViews'); $page = $this->page; } public function updatePageViews($event) { /** @var Page $page */ $page = $event->object; // don't add this to the admin pages if ($page->template == 'admin') return; if ($page->hasField('pageViews') and $this->user->isGuest) { //Update the number of page views for current page, but only visitor views not admin. $page->of(false); $page->pageViews ++; $this->pages->saveField($page, 'pageViews'); $page->of(true); } } and this way: public function ready() { $page = $this->page; if ($page->hasField('pageViews') and $this->user->isGuest) { //Update the number of page views for current page, but only visitor views not admin. $page->of(false); $page->pageViews ++; $this->pages->saveField($page, 'pageViews'); $page->of(true); } } But neither of them seem to do anything with template caching enabled. Any idea what I'm doing wrong? Edit: I found the problem isGuest needs brackets, ie isGuest()
  5. Update: In addition to the modules previously mentioned, the site now uses Padloper to add shopping cart functionality, and PaymentStripe and PaymentInvoice modules. I've also made some modifications to the MapMarker module so that I can use KML files from a separate files field as map overlays. This is really handy, as I can use Google Earth to define paths and areas that I can overlay on the map, which I can export and display with Processwire. In the process, of implementation with the payment modules, I discovered an issue with module dependencies and the modules cache in the database, which I've discussed and resolved here: https://processwire.com/talk/topic/19606-class-not-found-error/?tab=comments#comment-170031
  6. This was coming from an old CMS. I used Source: index.mvc?ArticleID={id} Destination: [[wid={id}]]
  7. It's great to see a government agency using Processwire. Here across the Tasman, I think Silverstripe has been mandated as the government CMS of choice which is sort of ok in some respects, but it's a lot more complex than it needs to be for many projects.
  8. Some people think that anyone who works in any form of IT is made of money, but sadly it's not always the case. I know the feeling about dying laptops. About a year ago, when it was just over 3 years old, the motherboard on my laptop died. Fortunately I was able to track down a replacement part on Ebay, and after carefully removing a lot of screws, swapping over the CPU and heatsink, and convincing Windows that I wasn't running a pirated copy, I managed to get up and going again. My desktop is a bit long in the tooth too, but since I upgraded the hard drive in my laptop and added an external screen and keyboard, the desktop tends to get less use now, although it was a lifesaver when I needed to get online to order the replacement motherboard for the laptop, and do some work while I waited for the part to arrive.
  9. I could use a field like this. I have a directory of local businesses and non-profit organisations, but sometimes their websites change or they go out of business, so it would be really handy to be able to run an automated script that can either hide or un-publish any listings that don't have a valid address. That would save on manually checking every one on a periodic basis to make sure they still exist. Of course I'd probably still double check manually any that get deactivated before removing them, but it would make the process a lot more efficient.
  10. Thanks. I didn't think to look there. There do seem to be a few dire warnings in that post about being careful with using advanced mode, but image fields are very much a core functionality, so hopefully there won't be any issues.
  11. A number of field properties can be specified on a per-template basis that override the field definition. For example it is possible to set minimum and maximum length for text fields, so that it is possible to use the same field on several different templates, but with some different specifications on different templates. It would be nice to be able to do this with image fields, as sometimes I've found I've needed to create multiple image fields simply because on different templates I want to enforce different maximum dimensions. I'm not sure how complicated this would be to implement, but in some scenarios it could potentially cut down the number of fields required quite substantially.
  12. I've managed to resolve the problem. I actually still think the issue might be a core ProcessWire one, but at least I know how to fix it now. Yes, I'm using the PW3 branch of Padloper, and it's working fine on other sites on my WAMP setup. I'm using AIOM+ on many sites with PW3 and it's working fine on all the others. I tried manually deleting all the entries in the cache table in phpMySQL and that allowed me to get into the site admin again temporarily, although it gave some notification about some modules that actually are present not being installed. I went to modules, and did a refresh, and the error came back. One thing I noticed that I wonder about, but don't know enough about how Processwire handles loading modules, is looking at the Modules.site/modules/ entry in the cache table, the modules seem to be listed in alphabetical order, and the offending module that is generating the error is listed before the module that it depends on, which it claims can't be found. I'd hope this shouldn't matter, as it could have serious implications for module naming, as the offending module was working previously, but it seems it does. I manually edited the order of the modules listed in the cache entry via phpMySQL, and the error went away. I've tracked down the issue with AIOM+ I think. There was a namespace conflct in that a reference to a root PHP class was picking up the ProcessWire namespace and obviously not working. I think I must have added a namespace statement to the module so that the module compiler didn't have to do it, but forgot to check any possible conflicts. The good news is AIOM+ works fine without namespaces in Processwire 3.x I think the AIOM+ problem might have actually been a red-herring with me trying to add namespaces to everything to try to get the first error to go away. The real culprit here is that if the Modules.site/modules/ gets regenerated somehow, it seems it can potentially break a site, as it will add modules in alphanumeric order, and if a module depends on another one that comes later in the sort order, then the class will not be found. This can be fixed with careful naming of modules so that a module that has dependencies will always be listed after any dependencies, so in the case of PaymentInvoice, since it depends on PaymentModule, it probably should have been called PaymentModuleInvoice which would ensure that regenerating the modules cache would always load it after PaymentModule.
  13. Further development: I tried deleting the module that said that it couldn't find Payment Module. That solved that error, but now AllInOneMinify module is giving a similar error saying that it can't locate a class that it depends on, even though nothing has changed. Other sites on the same development server are working fine. This has certainly shaken my confidence a bit in the robustness of Processwire, if seemingly at random, it starts throwing out errors about a whole range of supposedly missing classes that are definitely there, and it seems a bit random, as why does it report certain classes missing but not others?
  14. I'm having an odd error similar to this: I'm running WAMP on Windows 10, with Processwire, and get an internal server error trying to access either the front end or admin. Checking my logs I find: Error: Class 'ProcessWire\PaymentModule' not found (line 3 of ...\processwire\site\modules\PaymentInvoice\PaymentInvoice.module) The PaymentModule classs definitely exists, and hasn't been modified, and is namespaced. The other thing I've noticed, is in the modules.txt log usually modules are installed via the site admin, however just before I started getting the error, I see a reference to a new module being installed via access to a frontend page via the following code. $checkout = $modules->get("PadOnePageCheckout"); $checkout->setShippingModule("ShippingFixed"); $checkout->setPaymentModule("PaymentStripe"); // This module was not installed at the point the page was viewed, triggering the module to install. Normally, following module installation, there is an entry in modules.txt saying Saved module info caches. In this case there is no entry for this. The module that installed via the front-end extends the module in question that is supposedly missing. Before the whole site went down, I noticed that the PaymentStripe module was not showing as installable or installed modules, in admin, however it is not this module that is claimed to be missing, but PaymentModule which it extends, and it is another payment module, PaymentInvoice that generates the error. The site was working, although PaymentStripe wasn't showing up in the modules list, until suddenly everything stopped. I'm using the premium Padloper shopping cart package, however I understand payment modules can be used independently of Padloper, and I'm not sure the issue actually relates to Padloper directly.
  15. I'm on PW 3.0.104 and having the same problem.
×
×
  • Create New...