Closed Jonjoe closed 9 years ago
I'll contact the guy who did made that pull request to see if he can fix it! I'm just super busy at the moment haha.
I think the problem is that oFileUploaded is defined in function shopify._setOptions(), but if you don't supply the options parameter to the gulpShopify() call, shopify._setOptions probably never get called, hence oFileUploaded is undefined. Just change the call to gulpShopfiy() (in gulpfile.js) to something like this and it should fix the problem (the empty object being the options parameter):
gulpShopify('API_KEY', 'PASSWORD', 'SHOP.myshopify.com', null, {})
@mikenorthorp thank you!
We're using your plugin as part of our build script for a big ecommerce project and this change broke the workflow for anyone who npm-installed after it was updated. It would be great if the NPM module would stick to the verion number that's specified in our package.json
See #12
I'm a little bit confused as to what oFileUploaded
actually is. After a successful upload, this line is called: shopify.oFileUploaded()
. Taking a look at the options, we get this: shopify.oFileUploaded = (options.hasOwnProperty("oFileUploaded") && options.oFileUploaded) || (function () {return undefined; })
. The first conditional sets oFileUploaded
to true
if the property is set and equates to true
. This is already a problem, because it would break the above line of code that tries to call oFileUploaded
as a function. However, this never happens, and as a result, shopify.oFileUploaded
always returns a function that does nothing. I really don't understand why this is here at all, unless I'm missing something? I've removed all of this and it still works fine, so I'll submit a PR.
Yea that sounds good, it was someone elses PR that made the initial change. And Joel, can't you just specify the version number in your package.json to not use the latest?
On Thu, Aug 13, 2015 at 11:45 PM, Christian Varga notifications@github.com wrote:
I'm a little bit confused as to what oFileUploaded actually is. After a successful upload, this line is called: shopify.oFileUploaded(). Taking a look at the options, we get this: shopify.oFileUploaded = (options.hasOwnProperty("oFileUploaded") && options.oFileUploaded) || (function () {return undefined; }). The first conditional sets oFileUploaded to true if the property is set and equates to true. This is already a problem, because it would break the above line of code that tries to call oFileUploaded as a function. However, this never happens, and as a result, shopify.oFileUploaded always returns a function that does nothing. I really don't understand why this is here at all, unless I'm missing something? I've removed all of this and it still works fine, so I'll submit a PR.
— Reply to this email directly or view it on GitHub https://github.com/mikenorthorp/gulp-shopify-upload/issues/13#issuecomment-130933643 .
Im going to make the issues a priority to fix tomorrow morning since I'll have some free time then.
On Fri, Aug 14, 2015 at 12:02 AM, Michael Northorp mike.northorp@gmail.com wrote:
Yea that sounds good, it was someone elses PR that made the initial change. And Joel, can't you just specify the version number in your package.json to not use the latest?
On Thu, Aug 13, 2015 at 11:45 PM, Christian Varga < notifications@github.com> wrote:
I'm a little bit confused as to what oFileUploaded actually is. After a successful upload, this line is called: shopify.oFileUploaded(). Taking a look at the options, we get this: shopify.oFileUploaded = (options.hasOwnProperty("oFileUploaded") && options.oFileUploaded) || (function () {return undefined; }). The first conditional sets oFileUploaded to true if the property is set and equates to true. This is already a problem, because it would break the above line of code that tries to call oFileUploaded as a function. However, this never happens, and as a result, shopify.oFileUploaded always returns a function that does nothing. I really don't understand why this is here at all, unless I'm missing something? I've removed all of this and it still works fine, so I'll submit a PR.
— Reply to this email directly or view it on GitHub https://github.com/mikenorthorp/gulp-shopify-upload/issues/13#issuecomment-130933643 .
Fixed this issue, holding off on future PR's for now as well until I have time to review them.
Looks like
.oFileUploaded()
is not being declared properly