• Content Count

  • Joined

  • Last visited

Community Reputation

51 Excellent

About chrizz

  • Rank
    Full Member

Profile Information

  • Gender
  • Location
    Berlin, Germany

Recent Profile Visitors

3,476 profile views
  1. chrizz

    @kixe Awesome! I guess that explained in pretty much in detail! And guess what: after ignoring this problem for 24h now it solved itself... like always Thank you very much for this detailed explanation!
  2. this question can be also asked on stackoverflow, but I think supporting the local forum is much better I discovered the following issue while using PHPunit tests to cover some module methods: If I declare an array in the init() method of a module it's not accessible in another method called from the testcase. If I move the same array initialization to the __construct() method it's working as expected. I am not sure if this is an issue with PHPunit, PW or just a misunderstanding by me. Is there anyone out there who has some more expert knowledge about this? Thanks!
  3. chrizz

    to finalize this approach if($f->type->manager->getOptions($f)->has("title=".$this->input->whitelist("userInput"))) { // user selection is valid }
  4. 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
  5. thanks everyone for clarification. It was obvious as it wasn't mentioned in the documentation but sometimes asking for help offer new implementation approaches :))
  6. 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!
  7. chrizz

    awesome! thanks so much @adrian!
  8. 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.
  9. 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
  10. 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?
  11. 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:
  12. @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
  13. 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
  14. 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
  15. 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!