Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. has_parent doesn't work (or at least not correctly) with OR pipes. The only way to make that work is with OR groups like so: branch=(has_parent=1234), branch=(has_parent=1237)
  2. You can't. Repeaters link repeated pages with their original page they belong to. As a module's config is not a page that not possible.
  3. $config->httpHosts whitelisting will not prevent processwire from rendering the page, but only $config->httpHost will not match the actual domain if it's not a whitelisted one. So the issue you're having are probably not related to processwire but rather to your domain / webserver setup. The latter can include the settings in the .htaccess of processwire.
  4. I've just tagged 0.3.0-RC1 on Github. I've replaced league/climate with symfony/console to allow for more advanced parameter parsing => nicer commands. Documentation on the new cli commands by now can be found running migrate or migrate [command] -h. The commands migrate/rollback do now support multiple arguments from the cli as well as via the processwire module: integer: migrate/rollback that number of files filename (/path, but does fallback to filename comparison) classname * : migrate/rollback all ("*" in the terminal) In addition to that does migrate also have an option to only use "latest" migrations, which are the ones newer than the latest migrated file instead of all files not migrated. Other changes: Made the mysql table name lowercase to prevent issues with case sensitivity. Migration files are now managed via custom WireData/WireArray classes, which made the code quite a bit nicer than passing around just filenames. Custom migration templates can be put in /site/migrations/templates/. These can be created via migrate create:custom -t [type]. I'd appreciate it if some of you guys could take a look at it if there are any issues I've missed.
  5. Sorry, was on mobile so couldn't add a code sample. $precioschico = $page->get("planos"); $preciosgrande = $page->get("mapas"); $precios = $precioschico->makeCopy(); // So we don't change the variable itself on the next line $precios->import($preciosgrande); foreach( $precios as $precio ) { echo $precio . '<br/>'; }
  6. https://processwire.com/api/ref/wire-array/import/
  7. Yes and no. Not having access to those is what those visibility rules are for. If you really need to access blocked class contents you can use the Reflection class in php to inspect further than what's public, but this is mostly meant for code inspection.
  8. $event->object and $this refer to the same object. The difference is that hooks are not "inside" the class, so you can only access public methods/properties, while the core class can access all of it's own methods/properties. http://php.net/manual/en/language.oop5.visibility.php http://php.net/manual/en/language.oop5.inheritance.php
  9. I think currently the only sane way would be to display a warning in the admin, that dependencies are missing, if the needed classes are not loaded. I mean one can still install those manually without using composer. Composer just makes it a heck of a lot easier.
  10. This is certainly a nice idea. I'd also really like to see this as database level selector. And you can shorten the method hook quite a bit like this: $this->wire()->addHook('Page::parentLevel', function(HookEvent $event) { $level = (int) $event->arguments(0); if($level < 0) return $event->return = new NullPage(); $event->return = $event->object->parents->append($event->object)->eq($level) ?: new NullPage(); }); Edit: Without the second line in the hook it would also accept $page->parentLevel(-3), which goes from the current page upwards.
  11. There's also the MarkupCache module, which is similar to WireCache, but file based. ProCache is indeed a nice solution, but like TemplateCache it's not going to solve @adrianmak's problem of caching different markup for mobile/desktop requests.
  12. That's to be expected. The template cache is just a quick way to cache pages of a specific template. It doesn't care about how the page is rendered. It identifies cache files just by the page id. If you need more control rather use WireCache.
  13. Multi-language descriptions are handled directly in the Pagefile class.
  14. To install processwire you either need to run through the web install via some kind of headless browser or mimic what the install.php does on your own. There's also wireshell which can help you install processwire, but it's still in development for 3.x support. ProcessWire does not offer automated installs in the core. Also there's currently no (released) solution for any shared update/maintenance functionality, neither core nor 3rd party. The latter request is a pretty advanced feature, which is not so easy to pull off if you want to ensure nothing randomly breaks for your users, so I'd doubt you finding a 100% fitting solution even if there were some available. It can be as easy as replacing the .htaccess/index.php/wire folder, but you probably also need some capabilities to control updates, rollback or exclude some users for updates if they have issues.
  15. Yep, does look like that. Thanks.
  16. I'm not sure if comparing database dumps is really something to draw conclusions from for someone not so confident with the api. @Richard Jedlička The letters stand for the different types of migrations. https://lostkobrakai.github.io/Migrations/examples/#specialized-migration-types
  17. There's no way to test a migration beyond just using it. That's why I feel the downgrade functionality is so important. It enables you to quickly iterate on things missing. Also keep migrations small and focused on a single concern. Personally I don't even worry about backing up my database just for running a single migration. I'm using CronjobDatabaseBackup, which does a backup every day or so and I've not restored once of of them by now. There's not really to much, where you would destroy something not quickly fixable via the admin backend. For more involved changes, where lot's of pages are affected I also like to split things up in multiple migrations, which I can run manually – checking things after each migration. After a few initial migrations written the potential of bugs will also considerably drop for everything "standard". E.g. creating a field with a FieldMigrations is essentially just setting some properties. The hard stuff is already taken care for. If you make errors there it's a matter of deleting the field and rerunning the migration and everythings fine again.
  18. $articles = $pages->find("parent=/archive/, limit=10, id!=[parent=/archive/, start=0, limit=10]"); I'm not sure if subselectors support limits, so maybe you need to run it as it's own $pages->find() before this line.
  19. CKEditor is meant to be composed with different plugins, so the core is as small as possible, while people can add the things they need without the overhead of things they don't need.
  20. If you're on PW 3 take a look at findMany(). Otherwise there's this method of cycling through pages without running into memory issues: https://github.com/LostKobrakai/Migrations/blob/e94427abff04189f145e24c51a70fb6190e29c2e/Migration.php#L18-L30
  21. I'd imagine, that's because system notifications would run in the main window as well as in the modal at the same time, because of it's ajax functionality. That's most likely not the result one does hope for.
  22. You can tell system notifications to skip session notifications and show only ajax ones as "popups".
  23. ProcessWire's compiler will add the ProcessWire namespace for it's core classes if the template file does not have a namespace. This ensures backwards compatibility of template files. If you don't know how namespaces work I'd suggest looking elsewhere (e.g. http://php.net/manual/en/language.namespaces.php), as the processwire compiler will make things work even though the template files might be technically incorrect before compilation.
  24. With php7 I don't see any reason why one would run hhvm besides at enterprice scale. Without 100% feature parity to php using hhvm is trading a spark more speed for the potential of having unexpected issues, which are probably hard to debug/reason about.
  25. With pagefields now being filterable at runtime is it also ready for paginated inputfields? I'd think it should be.
×
×
  • Create New...