Closed (fixed)
Project:
Icomoon
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Oct 2013 at 16:30 UTC
Updated:
5 Mar 2014 at 18:20 UTC
Jump to comment: Most recent
Hello I need an Iconmoon provider for the Icon API. If you posted your development work I would be willing to post any patches I come up with to get it working.
Thanks.
Comments
Comment #1
markhalliwellActually I don't have any code yet. I've been waiting for that the maintainer of that project to add a packaged JSON file:
https://github.com/Keyamoon/IcoMoon-App/issues/57#issuecomment-23023621
Apparently though, they removed their GH project entirely. I was able to find this comment in my mail:
I have no idea when this project will even be able to begin development. I simply claimed the namespace so it will work with Icon API.
Comment #2
markhalliwellI've updated the project page.
Comment #3
dustin@pi commentedThanks for the update!
Comment #4
dustin@pi commentedTwo things:
Mark, if you are interested in starting this in the next little bit I can help with testing (and some debugging/patching).
Comment #5
markhalliwell@Dustin@PI: I would appreciate any patches. It will likely be very identical to the https://drupal.org/project/fontello module, expect checking for and parsing the IcoMoon specific json file.
Comment #6
dustin@pi commentedHi Mark,
I have been looking at cloning the Fontello module (I'll probablly post it to a sandbox rather than as a patch).
One question: does the IconAPI assume that it's always going to be a .zip file and open the archive for you? In the Fontello module code all the file operations seem to be directly against the files and there doesn't seem to be anything that deals with the archive format.
Thanks!
Dustin.
Comment #7
markhalliwellNo, Icon API utilizes core's archiver class automatically and, yes, does extract the archive depending on what the server configuration allows. This means that technically any archive (zip, tar.gz, etc.) could be extracted, however these services typically just spit out a zip. @see icon_archive_extract()
I would recommend going over includes/import.inc in Icon API pretty extensively. From there you can see the form, how it validates (which calls hook_icon_PROVIDER_import_validate() for the automatic detection feature) and submission (which calls hook_icon_PROVIDER_import_process() to process the archive).
There's really no need for a sandbox. To be completely honest, I'd rather just make you a co-maintainer so you can commit directly. These types of modules aren't that difficult to maintain once they're initially setup.
I'll go ahead clone the fontello module and rename some stuff to create the initial branch.
Comment #8
markhalliwellOk, I created the initial module from a clone of the fontello module. I renamed most of everything, but you'll likely need to do some cleanup. I added a few @todo's through out. When you're ready to make a release, just ping me here so I can review and test as well.
Thanks @Dustin@PI!
Comment #9
markhalliwellComment #10
dustin@pi commentedFYI ... I'm nearly done, just a bit more clean up. There's a lot less features for icomoon (no animations, only one include method, no IE 7 support), so the work was mainly removing code and remapping config.json to selections.json.
Questions:
(1) do you want me to attach as a Diff? Alternately I'm fine being a committer.
(2) Having a bit of problem with the way
icon_archive_extractis setting the $extract location. Fontello has it's files an extra level deep, but icomoon's json file is right at the root of the archive.i.e.
I patched icon/includes/import.inc as per the following (let me know if you want me to post a issue/patch to the icon issue queue).
Comment #11
markhalliwell1. just commit directly to this repo.
2. provide a patch in the icon module.
Comment #12
drupov commentedHi Dustin@PI,
do you have something commitable already?
I guess this module should be in a starting phase together with the patch https://drupal.org/node/2183233 (as in #10 (2))?
Thanks
Comment #13
markhalliwellCommitted 95fd6ca:
I'll have to release icon-7.x-1.0-beta4 before I can make a release here.
Comment #14
markhalliwellIcon API: 7.x-1.0-beta4 (https://drupal.org/node/2197225)
Icomoon: 7.x-1.0 (https://drupal.org/node/2197235)
Comment #15
drupov commentedCool, just confirming that it works!
Thanks!
Comment #16
dustin@pi commentedThanks Mark! I had it mostly working two weeks ago but I still had one bug and I haven't had time to go back and figure out what it was. Your code is a bit cleaner then what I had anyway. I'll run some tests today.