• Content count

  • Joined

  • Last visited

Community Reputation

26 Excellent

About BrendonKoz

  • Rank
    Full Member
  • Birthday 12/12/1980

Profile Information

  • Gender
  • Location
    Saratoga Springs, NY, USA

Recent Profile Visitors

2,252 profile views
  1. I appreciate the further glance - though it's most definitely in an unfinished state. When I couldn't get a database save to work I panicked a bit and rewrote some areas (not necessarily finishing them). That said, it's good to make me think about it again - I might've forgotten to go back and fix it up. I still want to provide a few data provider options (manual entry, OpenLibrary, Polaris ILS, etc) through module configuration; need to fix up the interface and figure out accessibility/internationalization concerns, then do some further testing. There's still quite a bit to do yet (I'm primarily stumped at the UI, have a few possible directions I can go), but at least now I can happily move forward! EDIT: Confused myself. Sanitization is currently being done in OpenLibraryBook::set() -- though it'll be a little different once I add various data providers for the book information. I tried checking your website for an Amazon Wishlist or Paypal link (i.e.: "Did I help you? Consider buying me a coffee."). If you want some coffee money, PM me a wishlist or Paypal email.
  2. I was honestly expecting a facepalm (missing $, semi-colon, or maybe typehint). Thank you so, so, so, so much!
  3. I began writing this module from scratch, basing it off simple examples of modules, trying to learn the necessary methods required to create a fieldtype. I was WAY off, but learned a lot. Eventually I moved towards examining the FieldtypeEvents example from Ryan and, in many areas, copy/pasting and then adjusting the code (and then trying to determine what it all was doing) method by method, file by file (from his example to my module). I've gotten to the point where I was ready to test the code - I haven't fully fleshed out my visual interface, nor integrated any of the 3rd party API tools this will (can) take advantage of. I also haven't implemented any JS or CSS for the interface. Right now I'm just trying to get it to save and then display any of the data that has been entered into the form fields of a template from the admin. When I save the page, the field is reset to defaults and no feedback message (for the field) is shown at the top of the page upon reload. When using Tracy Debugger from within the processInput method (immediately attempting to debug the $input variable), Tracy caught no data to be shown. If anyone has some time to take a quick look and see what I might've done wrong I'd be super grateful. I've had no forward progress in about 3 days (and like many others was unable to get Xdebug breakpoints working in PHPStorm).
  4. Is it dynamically creating a custom template on-the-fly? Just quickly thinking how it works, though it doesn't really matter. Quite slick indeed.
  5. BrendonKoz

    The purpose of the module is to provide a way to display Leaflet Maps. Leaflet =/= OpenStreetMap. Leaflet is a map display library whereas OpenStreetMaps is the actual map layer data source. OSM can be displayed using Leaflet (popular), OpenLayers, or even Google's map library, so I don't know (for sure) if the purpose of the module was specifically to avoid using Google's technology behind the scenes (which it does anyway as is evidenced from previous discussions of the code). I prefer OpenStreetMaps' imagery and ToS, but prefer Google's geocoder. Like I said though, your fork of the code is your own -- it did not have to follow my personal ideas.
  6. BrendonKoz

    I took a look at it. This is not the same thing that I was trying to accomplish (not that it has to be). These alterations don't use the Google geocoder's returned JSON data, it uses OpenStreetMap. I don't remember how, but I do remember I was able to get the JSON results of the OpenStreetMap geocoded data without any modifications to the module. What I was unable to get was the same values (100% of the time) from Google's geocoder, which contains more information (and often, I've found, more properly formatted and correct) than the OpenStreetMaps version. Because the found addresses for PLACES don't always match ("NYS Public Library" might not list a street address on OpenStreetMap, but Google will include everything), doing a manual lookup with Google's geocoder after-the-fact won't work 100% of the time. (Those were some of my reasons anyway.) As for code: When changing a version number that has companion modules you'd probably want them all to match. Just a suggestion for any future possible patches. LeafletMapMarker.php around line 62: } else if($key == 'raw') { $value = $value; } At first I did that too in my version (I think I removed it in my repo, maybe not) but that's just unnecessary. Still looking through the rest as like I said, I don't fully grasp FieldtypeModule code.
  7. BrendonKoz

    Congratulations on your success. If you're going to make a pull request I'd make it to the original Fieldtype module as that was the only reason I had forked the original module's code to begin with - to have workable code to store the raw return data, and offer a possible pull request.
  8. BrendonKoz

    If the only JSON+LD to be displayed will be event type, I'm personally planning to just hardcode it into the template rather than run another module. I did install that module originally with that intention but it mostly just attempts to simplify the creation of the template code. My `raw` field was used so that the rest of the module's code would be untouched and would continue to run as-is. If I could get it working I'd then add a module config option to offer to always save the raw data (or leave unchecked to not save it; default behavior). That way if the module author wanted to merge changes it wouldn't have any breaking changes. The schema upgrade method would have to be updated though. I didn't notice the other variables that may have worked before -- or maybe I did; if I did, they might've been a carry-over from the fork of Ryan Cramer's GoogleMaps implementation (some code is still the same). I didn't get time to look at this today so the code is no longer fresh in my memory.
  9. BrendonKoz

    I hadn't. I had previously installed TracyDebugger and couldn't figure out how to use it -- I think my problem was as simple as having installed it in the wrong PW instance (it's working now). I'll see if I can find any additional info from that, thank you for the tip! I had not, unfortunately. I was pulled from that task to work on an Omeka (archival CMS of sorts) theme and subsequent issues, and an application form using GIS shapefiles. I hope to be finishing the Omeka thing up today. If I have time later in the day I'll take another look into this. I too don't have much experience working with PW Fieldset modules; I've been trying to figure them out here and there though.
  10. BrendonKoz

    I realize my question is now outside the scope of this module, so I apologize in advance, and also have no expectation of a response -- just hopeful! By looking through this though I think I might be picking up some things with Fieldtype development that I couldn't quite grasp beforehand, so it's still useful (to me). Thank you for the response, @gebeer that was awesome! I made those, and some additional changes, but I've still been unable to get the data to save to the database (I'm instead saving an empty string value). I believe I might need some additional code somewhere, possibly in InputfieldLeafletMapMarker.module's ___processInput method? I tried commenting out the if/else block for whether a JS geocode had been done so that it would (should?) always perform a Google geocode, but that still didn't save to the DB. Any thoughts from anyone on what I might be missing here? I manually altered the database table to include the "raw" column in my field_{$name} field values. Changes (on Github): LeafletMapMarker.php [line 38] + $this->set('raw', ''); [line 96] + $this->raw = $json['results'][0]; InputfieldLeafletMapMarker.module [line 310] - "\$page->{$this->name}->zoom" . + "\$page->{$this->name}->zoom\n" . + "\$page->{$this->name}->raw" . FieldtypeLeafletMapMarker.module [line 106] + $marker->raw = $value['raw']; [line 136] - 'zoom' => $marker->zoom/*, + 'zoom' => $marker->zoom, + 'raw' => $marker->raw/*, [line 157] + $schema['raw'] = "TEXT"; // raw google geocode data
  11. BrendonKoz

    Does this module use Google's API at some point in the geocoding process? I noticed that there are calls to: LeafletMapMarker.php, and calls to... Control.Geocoder.js. I am using this Fieldtype on individual Events pages - it works well and made sense. I'm now trying to go back and add JSON+LD to all of those Events pages which requires a "Place" value (Example: Unfortunately the auto-corrected address field from the geocoder ($this->address in Leaflet) is not always something I can easily split into meaningful entities for the JSON+LD Event type's @Place type values. That said, the raw results originally returned from either geocoder (Google's being nicer in this regard, but OSM works too) can be used towards building this out. Based on how this module handles all of its data, is it feasible to extend it somehow to allow saving of the raw geocode data? If so, any ideas on where I might begin to look?
  12. I'd have never looked there. In fact, I know I didn't since I searched for the text string of "permi" in my *.php/*.module files. Dang. Thank you so much! Now I can fix all the other errors and continue on. Thank you!!!!
  13. I must obviously be doing something wrong in my hackish attempts to develop a Fieldtype. The inputfield and fieldtype are installed successfully, but as soon as I attempt to create a field using the fieldtype, I immediately (upon submit of the field creation form) receive a 500 error. It took me awhile to realize that ProcessWire was snatching the error message away from the server though! Error found in: /site/assets/logs/error.txt: This was a completely clean install of PW v3.0.78 running the classic theme. Immediately after setup I installed my "under development" fieldtype module and the above occurred. I'm uncertain where to look since this seems to be referencing hasPermission in a core file, but as far as I'm aware I wasn't referencing permissions in my (inputfield and fieldtype) modules. I've attached my files if anyone wants to take a quick look, but I'm still confused why a core file might be rendering the error. Someone else had this issue with their site during a module update, so perhaps it's a versioning issue (I very well may be mixing old PW module code with new)... FieldtypeBook.module InputfieldBook.module OpenLibraryBook.php
  14. Although this topic is nearly 6 years old, I wish I had seen it sooner. It took me about a week just to realize what the difference between Fieldtype and FieldtypeMulti was, and exactly (in my situation) which class (FieldtypeMulti) I wanted to extend for the Fieldtype I am trying to build, such as Fieldtype, FieldtypeMulti, or WireArray. I still don't entirely know exactly which methods are required, or why, though the code documentation in the base classes is quite awesome! I can copy and edit from what others have done, but I'm just hacking scripts together at this point, really. It may work in the end, but it also may not be the right way about doing things. If there's still any interest (and/or time!) in expanding upon this, Ryan, I know that I'd absolutely love it!
  15. BrendonKoz

    but i would love to see how others do I believe Ryan is using PHPStorm during development of ProcessWire, otherwise he wouldn't have added (and maintained) the .phpstorm.meta.php file to the GitHub repo that helps with its intellisense abilities. There's a 30-day trial of PHPStorm so if it's not better to you than VScode then you won't need to pay. I think PHPStorm's integrated debugger would likely work better though. (I'd still like to give VScode its fair chance, so will be testing that first.)