chrizz

Members
  • Content count

    81
  • Joined

  • Last visited

Community Reputation

49 Excellent

About chrizz

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    Berlin, Germany

Recent Profile Visitors

3,313 profile views
  1. chrizz

    to finalize this approach if($f->type->manager->getOptions($f)->has("title=".$this->input->whitelist("userInput"))) { // user selection is valid }
  2. I was wondering if there's an easy way to validate if a title is a valid value for a FieldtypeOptions field. I have created a field with different status values where only a single value can be selected: 1=done 2=planned 3=error Now I am going to update the page which includes this field which works fine so far - but: I I am using any other string than the defined options it stores a blank value. To avoid this I am trying to validate the input before. Something like getAllOptionsForField > in_array() etc would work but maybe there's a build-in method I am currently missing? Long story short: how would you validate if the given string is a valid option for a field? as usual: Thanks
  3. thanks everyone for clarification. It was obvious as it wasn't mentioned in the documentation but sometimes asking for help offer new implementation approaches :))
  4. hey there, I was wondering what the best approach looks like to access the input (entity) body from a POST or PUT request. I didn't find anything in the docs if $input supports these. If anyone has dealt with this problem in the past I'd be happy to hear about your solutions Thanks & cheers!
  5. chrizz

    awesome! thanks so much @adrian!
  6. chrizz

    Is there an easy way to enable/disable Tracy debugger via API? As I am still on my way to create test with PHPUnit it would be awesome if there's an easy way (ideally via config.php) to disable tracy if it's called from the phpunit testing scripts.
  7. chrizz

    Just as a heads up if someone needs database testing: I am trying a different approach at the moment: I simply added a database configuration to the config.php which is used if PW is called from PHPUnit. in config.php if(isset($_ENV['UNITTEST']) && $_ENV['UNITTEST'] == true) { $config->dbHost = 'localhost'; $config->dbName = 'db-test'; $config->dbUser = '...'; $config->dbPass = '...'; $config->dbPort = '3306'; $config->httpHosts = array('localhost'); } and my PHPUnit configuration.xml looks like this <phpunit ... some settings here ... > <php> <env name="UNITTEST" value="true" /> </php> </phpunit> maybe this will save someone a headache in the future
  8. I think these two lines would be fine. I guess you don't have the need for an additional module but maybe someone else will join the discussion with a different approach/opinion on that?
  9. Ah ok. I was afraid that I missed something But anyways: same does the module during the installation process: It adds language and country code fields to each language template. Regarding x-default, I'd recommend this for reading: https://www.rebelytics.com/multiple-hreflang-tags-one-url/
  10. @Sergio yeah, it's not that complicated - therefore I asked how you handle this before submitting a module Regarding your snippet: imho "x-default" is missing here. If you don't want you site to be listed in other languages/regions as defined than your snippets works fine but as soon as you have a default language for the world's audience this won't work. May I ask where this comes from? $language->lang_code; Maybe I have some weird old setup but this variable is empty
  11. hey there I guess a lot of you have already heard of the hreflang attribute which tells search engines which URL they should list on their result pages. For some of my projects I build this manually but now I am wondering if there's need to add this as a module to PW modules directory. How do you deal with the hreflang thingy? Would you you be happy if you can use a module for this or do you have concerns that using a module maybe does not cover your current use cases? Cheers, Chris
  12. I think this heavily depends on the use cases and the size of the project (e.g. amount of data, people involved). I am currently working on a project where I started to do everything from scratch, but then moved to PW because it saves a lot of time regarding standard functionality (e.g. permissions, login, caching, security in general). I have also worked for several companies building Saas platforms - for these kind of uses cases PW would be not the best choice. The use cases here were much to special, need a lot of DB tweaking, rely on different DB types (e.g. Elastic Search, Postgres, Lucene) and so on. If you want to save time by having standard functionality out of the box: I'd use PW. If you have enough capacity to build this on your own because you expect that you scale that fast that PW is simply the "wrong" framework: I'd think of a pure framework. But as said: It's easy to export data from PW, so this might be a third option: start with PW, scale fast, move to something else
  13. chrizz

    thanks for your feedback. I added the link in the post above. Don't know what went wrong during the submission process... maybe just a newbie error Thanks @adrianfor fixing it!
  14. chrizz

    Usually I write modules just for me and my projects because they are more or less individual. Mail Debugger is the first module which might be interested for someone else as well. https://modules.processwire.com/modules/mail-debugger/ Basically it covers two use cases: 1) Log outgoing emails 2) In debug mode mails are send to a specified email address instead of the original recipient(s) I checked the compatibility for PW 3+ because unfortunately I don't have any other version for testing currently. Feel free to drop me a comment if the module works also for older PW versions.
  15. chrizz

    yeah, that might be a approach I can test. Since I use a very comfortable way of modifying the date/time by freezing it at some point this could definitively work. Thanks for the idea of using a multi-instance