Jump to content

gebeer

Members
  • Posts

    1,554
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by gebeer

  1. I submitted an issue report: https://github.com/processwire/processwire-issues/issues/552 If you think, this should be fixed, please leave a comment on github. Thank you. I did not file this as a feature request because I consider it a bug. One would expect to display tabs as tabs and not as fieldsets. No matter whether in page edit or profile edit screen.
  2. @ethanbeyer Thank you for bringing this up. I also have the feeling that the profile edit page functionality can be improved. I recreated your example setup on the latest dev branch. Same behaviour here for repeater fields on the profile edit page of the member user when they only have profile-edit permissions. If you add page edit permissions to the member role and then go to the user template Access settings and add view and edit permissions for the member role, then the repeater field is working. But this is not a good solution. Because once you enable page-edit permissions for the member role, they get access to the page tree which might not be desired. And you'd have to go through all your templates' access settings to make sure that the member user can only do what you want to allow them to do which is a bit tedious. Also it is not obvious that you need to give page edit permissions for the user template to a role that already has profile edit permissions. Permission to edit the profile should imply the permission to edit the user template. All in all this is very confusing behaviour. I'd consider this a bug. Don't know if others would agree and would be happy to hear their opinion on this.
  3. Love this thread. Once you make a PR for the findArray to the PW repo, please let us know, so we can upvote it. I would definitely be willing to pay if RockDatatables was released as a pro module.
  4. Hello all, I'm experiencing serious issues when using PW built in template cache together wit AIOM. When a page is loaded from cache and you then change any of your CSS or JS assets, the rebuilding of the combined/minified versions is not being triggered at all. This explains @anttila's problem mentioned above. Also when you use the button in the module config screen to clear the asset cache, the template caches are not being cleared. So next time a page is loaded from cache, it will point to old asset files that do not exist anymore. I also did extensive testing with @matjazp's fork. But same problem there. After looking at the module code, I think that the problem lies in the module hooking into Page::render. But this never gets called once pages are cached. Please correct me if I'm wrong here. One possible solution would be to hook into PageRender::renderPage instead. This always gets called for every page request and returns a cached version if available or a fresh Page::render. I forked @matjazp's version as it seems to be the most up to date and will try to fix these issues...
  5. Interesting discussion about extra address fields. I created a fieldtype 'AddressGeoNames' that consists of separate text inputs for country, city, postcode, lat, lng etc. where field values are verified and partially auto populated through geonames.org API. This is a standalone Inputfield that geocodes through the google maps api. But it can also be connected to an InputfieldLeafletMapMarker field so that the given address will be rendered as pin on the map. The pin can also be manually repositioned and writes back lat/lng to the AddressGeonames field. I am currently using this in one live project with about 1500 users and they seem to get along fine with data input and geocoding. This is how it looks like when used next to a InputfieldLeafletMapMarker field: Planning on adding support for GoogleMapsMarker, too and eventually releasing it on github. Not quite ready yet, though. But if anyone is interested in the concept, I could share what I have so far.
  6. I can confirm that the module is still sending mails ok on my site. No errors.
  7. @patman I'd suggest making the PR to the original repo as this feature will be a good improvement to the original module.
  8. _js_geocode_address is used to hold the address that gets returned by the JS geocoding call, thats why the value is not set when rendering the field. This address is then stored to the data field in the DB on save. If you want to store the raw data in that data field, you also would need to change the schema, because it currently allows a max of 255 characters which will not be enough to store all the raw data. When you then retrieve the address in your template with $page->mylocationfieldname->address, it will return the raw data that you stored in that field. So you would need to extend the get method in LeafletMapMarker.php to return only the address and not the whole string. I think it would make more sense to extend the DB scheme and have a field raw that stores the raw data. You'd need a hidden field in the form, e.g. _js_geocode_raw that gets populated from the JS (just like the address field gets populated now) and then on save sends that value and stores it to the DB. You'd need to add that to the set method in LeafletMapMarker.php.
  9. @BrendonKoz Have you checked with some debug tool (I highly recommend Tracy Debugger Module) that $json['results'][0] has a value?
  10. @BrendonKoz The JS side of this module is using the OSM geocoder while the geocode() method in LeafletMapMarker.php is using the Google geocoder. If you wanted to save the raw data returned by Google geocoder, you would need to extend the database schema in FieldtypeLeafletMapMarker.module to add the necessary columns (e.g. streetAddress) to the table where data for this fieldtype ist stored. And extend the geocode method so it can save the raw data to the newly added columns. And add the respective keys to the construct method in LeafletMapMarker.php. Then you should be able to access your values in your template php like: $map = $modules->get('MarkupLeafletMap'); echo $map->streetAddress; and use those values to render the JSON+LD JS. You would either need to fork the original module and then add your code or write your own module that extends the original one and adds your methods.
  11. Hello, having the same problem as described by @Ivan Gretsky. Inside a namespaced module I have this method with a try catch block: public function addJson($pages, $filename) { $tmpPath = $this->files->tempDir('json'); try { $start = microtime(true); $jsondata = $this->getGeoJsonCollection($pages); $time = microtime(true) - $start; va_dump($time); // Note the intentional typo $filePath = $tmpPath . $filename; if($tmpPath && $jsondata) { //write json data into geojson.json file if(file_put_contents($filePath, $jsondata)) { $jsonPage = $this->jsonPage; $jsonPage->of(false); $file = $jsonPage->jsonfiles->getFile($filename); if($file) $jsonPage->jsonfiles->remove($file); $jsonPage->save(); $jsonPage->jsonfiles->add($filePath); $jsonPage->save(); if(!unlink($filePath)) $this->message("Error deleting temporary $filePath"); $this->message("$filename created and saved"); $this->log->save('json', "$filename created in $time seconds and saved"); return true; } else{ return false; } } } catch (\Exception $e) { $this->log->save('json', $e->getMessage()); } } I'm calling the module via command line from a worker php script that bootstraps PW. I get this ouput from my script and nothing logged to my custom json.text log file: PHP Fatal error: Call to undefined function ProcessWire\va_dump() in /var/www/uhtinew.dev/site/modules/SaveJson/SaveJson.module on line 208 Fatal error: Call to undefined function ProcessWire\va_dump() in /var/www/uhtinew.dev/site/modules/SaveJson/SaveJson.module on line 208 Error: Call to undefined function ProcessWire\va_dump() (line 208 of /var/www/uhtinew.dev/site/modules/SaveJson/SaveJson.module) This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. So it seems that WireException is catching this before my try catch.
  12. @BitPoet Thank you very much for the heads-up. Also to @Robin S. I finally ended up with this hook function in a module context which does exactly what I need, also in ajax mode: $this->addHookAfter('Field::getInputfield', $this, "lockConfirmedItems"); public function lockConfirmedItems(HookEvent $event) { if($this->user->isSuperuser() || $this->user->hasRole('certificationadmin')) return; $thisPage = wire('page'); // // Only run our locking logic if we are editing a user in the backend if($thisPage->process != "ProcessUser") return; $repeaterPage = $event->arguments(0); $context = $event->arguments(1); if($context != "_repeater" . $repeaterPage->id) return; if(!$repeaterPage->confirmed) return; $event->return->collapsed = 7; } Setting collapsed with the Inputfield constants like in BitPoet's code didn't work for me.
  13. Hello, I would like to prevent future editing of a repeater item once a checkbox in the repeater item has been checked. Either the form inputs of the repeater item should be read only or only the field values should be rendered. Looking at the module code I can't seem to figure out where to hook for that functionality. Any ideas would be much appreciated.
  14. @Pierre-Luc is there still no way to get feedback on success/errors when sending through the Mailgun API? I would like to build a Lister(Pro) Action around your module and for that I would like to show results after sending. Something like $mail->getResult(); in WireMailSMTP. EDIT: Guess I would need to use Mailgun Events for tracking emails. Right?
  15. Thank you for your suggestions. It is not that many mails, maybe a total of 100 a day and max 10-30 per hour. So I will stay with Gmail for the time being.
  16. @flydev That info is enlightening. Thank you! So I would have to extend the WireMailSmtp module to get that functionality, right? @horst
  17. I am experiencing problems when sending through Gmail on a site that is sending out quite a lot of emails to different recipients. It used to work for about a month and now suddenly Google is blocking my app. It seems that Google regards the app as less secure. I am wondering if someone has had similar issues with Gmail? I know there is a setting in Gmail to allow less secure apps. But I would like to know why Google thinks the app is less secure. Does it have something to do with headers being sent by WireMail that Google disqualifies as insecure? Here is the data array from the WireMailSmtp object (sensitive data has been replaced by xxx): default_charset => "UTF-8" (5) localhost => "dev.xxxtors.com" (31) smtp_host => "smtp.gmail.com" (14) smtp_port => 587 smtp_ssl => "" smtp_start_tls => 1 smtp_user => "info@xxxtors.com" (32) smtp_password => "xxx" (11) smtp_password2 => "" clear_smtp_password => "" realm => "" workstation => "" authentication_mechanism => "" smtp_debug => 0 smtp_html_debug => 0 sender_name => "xxx" (24) sender_email => "info@xxxtors.com" (32) sender_reply => "" sender_errors_to => "" sender_signature => "" sender_signature_html => "" send_sender_signature => "1" extra_headers => "" valid_recipients => "" smtp_certificate => "" And here the mail object data to => array (2) "xxx@gmail.com" => "xxx@gmail.com" (26) "xxx@mailbox.org" => "xxx@mailbox.org" (28) toName => array (2) "xxx@gmail.com" => "" "xxx@mailbox.org" => "" cc => array () ccName => array () bcc => array () from => "info@xxxtors.com" (32) fromName => "xxx" (24) priority => "" dispositionNotification => "" subject => "xxx" (51) body => "This is an automatically created email. Please do not reply. xxx" (139) bodyHTML => "xxx" (183) addSignature => NULL attachments => array () header => array (1) "X-Mailer" => "ProcessWire/WireMailSmtp" (24) sendSingle => FALSE sendBulk => FALSE useSentLog => FALSE wrapText => FALSE Does anyone have an idea why Gmail thinks these mails are less secure?
  18. Hi, I had the same situation as the OP described: URL sent by email to go to a specific page after login. I solved it with 2 small hooks that I added to a module. You could also add them to your admin.php or ready.php My URL looks like .../?member=1222 where 1222 is the id of a user 1. hook adds a session variable before Login $this->addHookBefore('ProcessLogin::execute', $this, 'setRedirectId'); public function setRedirectId(HookEvent $event) { if($this->input->get('member')) { $this->session->set('goToMember', $this->sanitizer->int($this->input->get('member')); } } 2. hook has the redirect logic and removes the session variable $this->addHookAfter('Session::login', $this, 'loginRedirects'); public function loginRedirects(HookEvent $event) { if($this->user->hasRole('certificationadmin') && $this->session->get('goToMember')) { $member = $this->pages->get($this->session->get('goToMember')); if($member && $member->id) { $this->session->remove('goToMember'); $this->session->redirect($member->statusPageUrl); // statusPageUrl is a custom property for users that I added via another hook } } }
  19. The problem in my case is that this project will have more than 2000 users that will logon from all over the world. So I guess I will have to disable session fingerprinting to make sure that everyone can connect without issues.
  20. @bernhard I'll see what I can do with the $config->sessionFingerprint settings to avoid these problems. Although I don't feel comfortable messing with security features...
  21. thank you both for your feedback. Is there anything we can do to work around those security restrictions? EDIT: guess it has something to do with $config->sessionFingerprint setting. I'll play around with that.
  22. Hello, I have a situation were a user cannot logon to several different PW installs fromdifferent machines on his workplace network. Sometimes the initial logon is working but when navigating the PW backend he gets thrown out. Sometimes even the initial logon is not working and he is redirected too many times and the browser throws a redirection error. This points to PW loosing it's session. But the same sites are working fine when accessed from within other network environments. The user's workplace network has some pretty tight security (firewall) restrictions in place that prevent PW keeping it's session. I don't know enough about network security so I can't tell what exactly could cause that problem. I checked in the browser settings to make sure session cookies are allowed and there. Has anyone ever experienced issues like that and would there be a way to make PW keep it's session under these circumstances?
  23. @adrian unfortunately I couldn't find the reason for this. My workaround with the new user is still working, though. The install where the error occured is running on 3.0.42. I can't say if it was related to an update. Really stepping in the dark on this one...
  24. Update: working with this setup for a few months, I had quite a few permission related issues which were frustrating. So I decided to do some more research on existing docker projects that are well maintained and bring the features I need. Finally I found http://laradock.io/. I've been using it for 3 months now and I am really happy with it. Very flexible and well maintained set of docker containers. I'm totally happy and can recommend it to devs who are interested in this topic.
  25. @Robin S thank you! I didn't find this in my search. Great that it is being taken care of
×
×
  • Create New...