-
Posts
1,990 -
Joined
-
Last visited
-
Days Won
164
Content Type
Profiles
Forums
Gallery
Downloads
Articles
Store
Blogs
Everything posted by wakabayashi
-
@Cassim I believe to quick fix for you would be to replace ImageType::getFormatedName('medium') with ImageType::getFormatedName('category_medium') in AdminCategoriesController.php. Obviously this works only for your setup and we can't do this in the core right now.
- 13 replies
-
- subcategory images
- imagesize
-
(and 1 more)
Tagged with:
-
Looked into this, as I am rewriting the whole image usage in tb. The main issue here is ImageType::getFormatedName(). It's not been able to return 'category_medium'. We could improve this function by adding $imageTypes and $entityType stuff there. But it gets more complex, not sure if it helps in the long run. To have a very clean solution, we actually should get rid off all this ImageType::getFormatedName(). Instead we offer a select configuration somewhere. That's actually no difference, to how modules should integrate image usage, right @datakick? Somehow this doesn't seem to be a quick fix π³
- 13 replies
-
- subcategory images
- imagesize
-
(and 1 more)
Tagged with:
-
I have crashed my site need some assistance if possible
wakabayashi replied to The Pellet Guy's question in Technical help
Good to see you could quickly solve the stressful issue π I am no expert at all on this field. But in plesk I can quite simply chose different php versions per site. Still I wanna add: Not even php 7 is supported anymore. If some creepy guys find a hole in an old php version like 5.6, you might be very vulnerable. It's always better, to update when you have time and no stress, as you can test a lot of stuff. -
How easy would it be to implement Cloudflare Turnstile free Captcha?
wakabayashi replied to ukclearance's topic in Modules
It has been a week now. No stupid spam emails since then. Will keep you updated π -
Yeah there are some issues with it. I remember, that I have at least outcommented the following: if ($orderStatus->logable && (string) $cartTotalPaid !== (string) $amountPaid) { $idOrderState = Configuration::get('PS_OS_ERROR'); } in validateOrder() of PaymentModule.php But surely that is not a clean solution. In general this problem is also a bit related to a messy order status handling. (These kind of problems are also known by our loved brother: https://github.com/PrestaShop/PrestaShop/discussions/31038)
-
@datakick What is your opinion about this copy method: https://github.com/thirtybees/thirtybees/blob/main/install-dev/models/install.php#L567-L572 I am concerned as we just save a png like it would be a jpg. Browsers can probably handle that, but I think it's not very good. What would be the correct way to really change $imageExtension in TB? Obviously ImageManager::resize() could do this, but as no resize is involved, I dunno, if it's good to use or if we should make a new (simpler) function for it? If I understand correct, it would be possible With Image::create() and Image::write() afterwards.
-
Right. As you correctly noticed, we have to change isCorrectImageFileExt() a bit, so that 'webp' is accepted there π Thats why I introduced a function getAllowedImageExtensions(). At the moment is quite raw, but in general this function should return the image types that are allowed to upload. Plan is to replace all hardcoded stuff with this function. So that a extension is always (or never) supported.
-
Oh ok. Didn't know that this is an existing bug. I personally could live with the simple solution (bottom screenshot). But ok, it's not popular to remove any existing feature, so it's better to fix this cleanly.
-
@datakick What is something like this good for: https://github.com/thirtybees/thirtybees/blob/main/classes/Language.php#L629-L643? English language might not even be installed and in my installation there are no such files Why do we need this files in all folders (category, manufacturer and so on)? Wouldn't it make more sense, to just store them in folder language ('l')? I have seen multiple such similair usecases. π @e-com Thanks for your link. I will look into it, but right now I am a bit overhelmed with all other things related to this rewrite ^^ Could you shortly explain what/why is not working with webp? Cause we have a webp support. I know, that it's not possible to upload webp images in BO for products. But that is actually just because of hardcoded values in some controller. In general I believe, that there is no issue with generating webp images... Might be wrong of course π₯΅ As you are very active and experienced dev, will you help to check my rewrite once I "finished" it? There will be bugs or at least stuff, I haven't taken into account. It's not possible for me to forseen/test every detail. π
-
Damn my brain seems to be damaged π€ Yeah, that's (obviously) the best solution. The hardcoding is just working by "luck". A theme could not even have something like 'home', 'home_default', 'niara_home' or whatever. That's actually where my idea ImageTypeBySize() came from. But you are right: if module devs give a select option, actually there would be no problem at all.
-
Ok, I have never thought that way. But yeah it makes sense to me too (at least in theory). So if this is true, it bascially means, that a module dev should "never" width="" height="" in a tpl file, right? But imo opinion it needs to be clear, what kind of type a module dev needs to load (in every situation). I guess that is what you mean by "Nowhere in the templates we should see strings constants." Haha, actually as almost always, when we have a lot of code for a single functionality π Ok, anyway I will try to continue my rewrite as good as possible. But this PR will be huge (lots of files invovled) and serious checks will be needed. I see more and more the need of this: https://github.com/thirtybees/thirtybees/pull/938. I believe, it's almost impossible, to have always a 100% clean image folder, that is also performant.
-
This sucker nerves me too π If you are using cloudflare, you might want give "turnstile" a try. I have coded a thirtybees module for it: I am using this module only since today. So I still will need to see, if it reduces the spammers...
-
How easy would it be to implement Cloudflare Turnstile free Captcha?
wakabayashi replied to ukclearance's topic in Modules
@ukclearance what is your expierence? I have now updated the module. I recommend you to use the new version. It allows a bit more settings: Note: custom submits is a VERY basic implementation. If turnstile turns out to be effective. I can improve this module in the future. From today I use it on my live shop too... I am bored of this shitty spam emails (even with google captcha) π₯΅ -
@datakick I am bit surprised how many function we have about getting ImageTypes and Image Link. It seems to me, that this is often about guessing, how an image type could be named. Multiple times we even search for something like '_default'. Why is this needed? I had the idea to use ImageTypes in a different way. There are a few thoughts: A theme designer always knows the image_type name (he has no problem to generate a link) A core dev and module dev don't know the images types for sure. (they might have a problem) BUT: always when you want to get an image_type it's actually about sizing (correct me if this is wrong?). So why don't we create a function getImageTypeBySize($min_height, $min_width), that does return the best existing/matching image_type. Of course we could then even improve this by something getImageLinkBySize(). Couldn't we drop then all the "guessing" like: Link::getProductImageUri() Link::getProductDefaultImageUri() ImageType::resolveImageTypeNameWithoutCache() These things are actually not totally related to image extension, but it's quite complicated to cleanup files at some points. It's very hard to forseen, what happens if you replace a hardcoded '.jpg' with something like $imageExtension that could be everything.
-
@the.rampage.rado Btw can you tell me more about the Warehouse usage of jpg? How and where are this images be loaded? Is this in a tpl file and '.jpg' is hardcoded?
-
That's what the fallback mechanism is good for. Sure I will hold them too. The question is in which Extension we should hold them. At the moment it's forced to be always jpg. I don't like that. I guess it's best to hold the format, that was uploaded.
-
I plan to really simplify things (get rid of some code). Some questions arise in this context... The idea is, that you select one image format and that all generated files (thumbnails) are saved in this format. Should it be possible to hold original files in the original file format? Let's say you use webp, but upload a png. Should the original file always be converted in webp or should it be possible to hold it as png? The later makes things more complex and bit slower. Which formats should we allow to upload in BO? jpg, gif, png and webp? Which formats should be allowed for thumbnails. jpg and webp for sure, but png as well? Edit: Also I hope that we can get a more consistent wording. The word "type" is used for at least 3 different things. It can mean entityType (product), imageType (cart_default) or imageExtension (jpg). It makes hard, to read the code like this.
-
Project of consistent webp support (and image cleanup in general) started: https://github.com/eschiendorfer/thirtybees/tree/cleanWebpSupport Help by another dev is welcomed π
-
All purchase_supplier_price in order_detail table wrong!?
wakabayashi replied to wakabayashi's topic in English
Ok I have submitted a PR https://github.com/thirtybees/thirtybees/pull/1623. This will allow the usage of fixed fees for carriers. It will also save the costs to the DB. Which means, that your old order profits don't change, if you change your costs config values π -
Da hast du vΓΆllig Recht. TB ist in vielen Dingen funktionsstark, aber das geht auf Kosten der Einfachheit. Da kΓΆnnte man viel herausholen.
-
What is the advantage of it? You can also just install a new theme π
-
Error when try to checkout and pay after update to 1.4
wakabayashi replied to Havouza's topic in English
Oh sorry. I was not aware of such a functionality in core π΅ -
Error when try to checkout and pay after update to 1.4
wakabayashi replied to Havouza's topic in English
You give no information at all how this technically worked... Won't be possible to give any sensible answer. Is it a module? Is it handled on php, javascript or smarty? Core Updater can delete additional files. Even files, that were added manually by yourself but were placed in a core folder. Maybe it's related to a missing or old file. But ok that's just wild guessing from my side.