BrendonKoz

Members
  • Content count

    52
  • Joined

  • Last visited

Community Reputation

24 Excellent

About BrendonKoz

  • Rank
    Full Member
  • Birthday 12/12/1980

Profile Information

  • Gender
    Male
  • Location
    Saratoga Springs, NY, USA

Recent Profile Visitors

2,108 profile views
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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
  7. Does this module use Google's API at some point in the geocoding process? I noticed that there are calls to: http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address= ...in LeafletMapMarker.php, and calls to... http://nominatim.openstreetmap.org ...in 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: https://developers.google.com/search/docs/data-types/events). 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?
  8. 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!!!!
  9. 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)... https://processwire.com/talk/topic/16358-error-call-to-a-member-function-haspermission-on-null/ FieldtypeBook.info.json FieldtypeBook.module InputfieldBook.module OpenLibraryBook.php
  10. 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!
  11. 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.)
  12. Yes, I think I might have to. I'm using Atom right now and although there are Intellisense packages, it's already seeming sluggish. I'll give VS.code a try (also built on electron), but will likely need to buy a license to PHPStorm. Thanks again!
  13. It seems that, when developing a Fieldtype that requires user input (Inputfield, in this case), both modules must be developed in tandem? In other words, it's not something that could easily be tested against during development to create just the Fieldtype, or just an Inputfield (again, for something like this)? I didn't see your Edit before, but that was very helpful, as well as the mention of extending FieldtypeMulti (instead of just Fieldtype) -- thank you!! ...just saw the Module.php file in core -- so THAT's where all of the documentation is!
  14. Hi all, hopefully this is the correct (sub)forum to ask. I'm trying to undertake my first real (worthy?) module. I understand Textformatters, Markup, and Process modules, but I'm now looking to, I believe, create a module that behaves similarly to the Map Marker module(s); in my case I'm looking to add book information from an external service (insert ISBN or title into a text field and the service returns data that can then fill in other various fields). I'm confused for a few reasons...it seems I was not the only one. 1. Inputfield vs Fieldtype: I compared Ryan's FieldtypeMapMarker module and noticed that it also contained an Inputfield module. From the documentation's description between Fieldtypes and Inputfields I had a hard time discerning where my particular module would be categorized -- is this because I would also need two modules? Fieldtype: "Fieldtypes are modules that define a data type and field used to hold content for pages", and Inputfield: " One to gather input, and the other that handles the additional data (ex: author, publication date, cover art URL, etc.), that would otherwise be non-core? 2. For examples, I was trying to compare a few different FieldType modules, I looked at FieldtypeMapMarker by Ryan, FieldtypeDimension by soma, and InputfieldFlickr by apeisa (not a Fieldtype, but does something similar to MapMarker). They each seem to handle things differently (or perhaps I was looking too closely at comparing Flickr to MapMarker). When comparing any of these to the newer markup for module code I think I was just looking at too much all at once, but...are there actually multiple ways to go about doing the same thing that is fully supported by the CMF? 3. In what instances would a Fieldtype not also have an Inputfield (or some other form of input)? If not, is a Fieldtype simply a glue module? I'm also trying to determine if there are any other specific methods that are used/required solely for Fieldtypes by ProcessWire... Hopefully someone can help me clarify all of this. Thank you if you can!
  15. That is a perfect response! Funny too! I definitely wasn't thinking along those lines when I saw the permission, but it makes much more sense now. Haha. Thank you Robin S!