Jump to content

justb3a

Members
  • Posts

    321
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by justb3a

  1. @Christophe: Thanks now the links should work. The processwire module directory imports the readme from github. The problem is that I have to use absolute links in my github readme to make them work there. Relative links get the process wire module directory prepended (for example [installation](doc/installation.md)leads to modules.processwire.com/modules/simple-contact-form/doc/installation.md which does not exist). It's a bit annoying because an absolute link includes the name of the current branch which has to be master. And so I'm not able to test it before making a new release. The same applies for images.
  2. @rot: I expected such questions. Therefore I wrote a little introduction. You do not have to use this module. It's fine to use the other module. That's why I mentioned it. If you want to I can delete this thread/module and just use it for my own. I just started to validate some inputs and then it became more and more and I outsourced my code.
  3. TL;DR: I know, there is already an Validation Module. And it wasn't my intend to build another module. But I needed it in so many places which lead to duplicate code and suddenly there was a module Perhaps it's useful to someone. At the moment there are only validators I need in my current project, if you miss one, please tell me or (preferred) send a pull request! ------ This module provides a set of useful validation methods using ProcessWire sanitizers. Example Usage: $conf = array( 'username' => array('isEmpty', 'isUnique' => array('ident' => 'name', 'sanitize' => 'username')), 'pass' => array('range' => array('min' => 6, 'max' => 20)), 'pass_confirm' => array('isEqual' => array('equal' => 'pass')) ); $validator = new Validator; $validator->setConfig($conf); if (!$validator->isValid()) $errors = $validator->getErrors(); You can also use it to validate POST requests: $validator = new Validator; $validator->setConfig($validatorConf); // validation failed if (!$validator->isValid()) { $data = array( 'success' => false, 'errors' => $validator->getMessages() // $validator->getErrors() ); $this->returnJson($data, 400); } ❯ http -f POST http://pw.dev/v1/user/ email=info@com username=exampleUser pass=short { "errors": { "email": [ "Please enter a valid email address." ], "pass": [ "This field must be at least '6' characters.", "'short' must contain at least one digit character" ] }, "success": false } For a detailed documentation please have a look at the guides: Installation Usage Available Validators Error Messages phpunit Testing
  4. forgot to test using an older php version.. sorry It's corrected.
  5. New version 0.1.1 - improved template handling as well as adding optional clear up functionality for uninstalling the module. creating/updating templates after submitting the module settings add and/or remove fields works but you have to check the html structure manually additional checkbox for uninstall: "If you check the following box all data containing files as well as database content will be permanently erased with no chance for recovery. It's recommended to make a backup before uninstalling this module." @Ivan Gretsky: Now you can add/remove fields in the config (separated by comma). But make sure to check your html structure because I do not know your html structure. It's not that easy to determine the position to insert/remove code.
  6. @Matzze: You installed the module the right way and everything works as expected. This module provides some spam protection methods - and if this fails you will be redirected to the root page (I should add this to the readme!). Have a look at site ▸ assets ▸ logs ▸ simplecontactform-spam-log.txt. I guess there is an error like "2015-03-30 13:38:50 Date difference is out of range." The reason is antiSpamTimeMin (It parses the time the user needs to fill out the form. If the time is below a minimum time, the submission is treated as Spam.) in module settings. The html list is unstyled, you could/should change the html structure to your own needs as well as adding custom css. @Mike Anthony, @Ivan Gretsky : I know this is not the best solution, if somebody has an idea to improve this, just let me know! It's really important to enter and save the module settings first because depending on this the template(s) will be created.
  7. New version 0.1.0 adds some more spam protection possibilities and logging. CSRF validation mark messages as spam (by mail or/and ip address) logging for received messages and spam sort option for repeater items in backend to get the latest to the beginning of the list For more information have a look at the readme. NOTICE: If you upgrade an existing installation from 0.0.9 and below to the current version, there are some steps to be taken.
  8. ... I did not notice this topic. I would appreciate using the corresponding topic or at least including a keyword like "MobileDetect" in the topic title.
  9. I didn't noticed the following topic: Fallen at the first hurdle... I can definitely unterstand your point. Now you should be able to install the module the normal way. I removed the submodule and included the mobiledetect library via composer. Therefore the including path for the library changed but this doesn't matter for you. There is a new release version 0.0.4.
  10. New version 0.0.9 includes fixes for deactivated save message setting. On line :343 I removed the exclamation mark (!) and I corrected the instance to compare with. This has to be Page instead of Pages because findOne returns a single page (because of this double bug the messages has been stored). I included a second check here just to make sure that save messages is on. I also included this additional check on line :396.
  11. RT @wowa_TYPO3: WTF?? - Announcing TYPO3 CMS 4.5 Extended Long-Term-Support Plans http://t.co/WRURHeol7Y

  12. @pwired: @BrettMW: Indeed, I only tested this at the beginning with save message settings deactivated. Thanks for your feedback, I will test and implement this as soon as possible.
  13. RT @processwire: New module: Image Extra by @justb3a enables you to add more fields to an image (title, desc, link, etc.) – http://t.co/BTZ…

  14. @JoZ3: I'm not quite sure whether I understood your request right. You want to select an image to be the cover? If so I would suggest using tags. Activate the `use tags?` checkbox in image settings and enter the tag "cover" (or something else) for the specific image. In your template you can pick this image using the following code (adapted to your needs / field names, ..): page.images.getTag('cover');
  15. Thanks for the pull request. If you have multi language support activated there is no label for the description field (but I want to have one) and I want to add some padding. So I check whether it's a multi language installation - but one line didn't make it into the right area. It's corrected Default: missing label and padding for description
  16. Feel free to provide a solution here oder create a pull request. Otherwise I will look at this next week...
  17. That sounds reasonable and could explain other issues I couldn't reproduce. I've tested only with PHP version 5.5.18. I try to take some time next week to install version 5.3.8 (ProcessWire requires at least this version) and test all again. jeah...
  18. In line :213 the method for the image link is added. The other methods seems to work because the method for the link is called as the last one. Did you check the Add internal link field box? Uploading an image wasn't a problem? Did you add an image link? Does this error occurs on every page which contain this field?
  19. I have some modules included as a git submodule. So I don't use the update manager but the command ``git submodule update``. Everything works well except the display of the version. Is there a way to clear the module listing cache or to do something else to get the right version listed? EDIT: ok, that was too easy
  20. You corrected the names and therefore an empty entry will be saved. That's on line 767 So you don't have to extend the if condition I suggested (on line 311) because you know that there is always an entry with this key. Thanks for the quick fix. (I've been waiting for the strip_tags fix to be able to reset my deployment script because your module is included as a git submodule and I didn't want to change this. So I was quite sure to use the latest master version.)
  21. Thanks for adding strip_tags for smart fields I got a little bit of trouble regarding the new piwik including. Still after re-saving the module settings I get the following error: Notice: Undefined index: piwikAnalyticsUrl in /.../public/site/modules/MarkupSEO/MarkupSEO.module on line 311 On line 311 you need to check first if this array key exists because in the database there is just an entry for "piwikAnalytics":"" initially. As a quick fix I added ,"piwikAnalyticsUrl":"" manually. Changing line 311 to if (array_key_exists('piwikAnalyticsUrl', $configData) && $configData['piwikAnalyticsUrl']) or check if piwikAnalytics is not empty if (!empty($configData['piwikAnalytics']) && $configData['piwikAnalyticsUrl']) should solve this issue.
  22. annoyed by messages such as "sudo: g: command not found" - simple hack "alias sudo='sudo '" works pretty well :)

×
×
  • Create New...