Jimi Wikman Posted July 8, 2021 Posted July 8, 2021 Pages Category Images 2.0.0 seems to have bugged out a bit in 4.6? Is it just me or is it in need of a slight update?
All Astronauts Posted July 9, 2021 Author Posted July 9, 2021 (edited) PCI 3 Finally got this patched for 4.5/4.6 - will require no changes on your end at all. Might even be slightly faster (everything is datastore cached). I'll be uploading 3.x tonight and it will be approved when it is approved as all things MP are these days. I'll also post here again after I submit with the low-down. Edited July 9, 2021 by All Astronauts Jimi Wikman 1
All Astronauts Posted July 9, 2021 Author Posted July 9, 2021 (edited) PCI Version 3.0.2 submitted. 4.5.x and 4.6.x compatible. This moves all your images off the actual Pages Categories database table into a separate table. You do NOT need to change any of your template code; this remains 100% compatible with whatever you are doing before. Code examples for a reminder: <img src='{file="$category->pcimage"}'> The above where you have the $category variable available. <img src='{file="$record->container()->pcimage"}'> And that above for when you are in a record view template and have the $record variable available. You should be able to see the basic chain there record - then it call the container (which is the category the record is in) - and then our category image. I do have caching of the new PCI database table. 99.99% it will never be a problem, when the category is being built out it actually double checks for the cache and if not there does a load from the DB directly. If something happens though, you can refresh the cache directly in the ACP on the Pages Databases menu option and any database Categories menu option with the obvious, can't miss button up top. EDIT: Will edit/post when it is approved. Edited July 9, 2021 by All Astronauts Sonya* and Steph40 1 1
All Astronauts Posted July 14, 2021 Author Posted July 14, 2021 (edited) 🤷♂️ maybe they're busy? EDIT: Will be awhile longer; you can use the same Giphy I already used. ANOTHER EDIT: Daniel managed to find this one tiny thing out of the expansive pile of apps and plugins I have (There are a lot on my dev machine that never see the light of public day) that had this one thing leftover in a post-install routine. They probably aren't paying him enough. Edited July 15, 2021 by All Astronauts
Jimi Wikman Posted August 16, 2021 Posted August 16, 2021 Installed and tried to update a category and got this error: UPDATE `ipb_cms_database_categories` cms_database_categories SET `category_pcimage`='monthly_2021_07/Themes.png.887b794354ac36921365535fe9f395f9.png',`category_show_records`=true,`category_can_view_others`=true,`category_allow_anonymous`=false,`category_forum_override`=false WHERE category_id=190 IPS\Db\Exception: Unknown column 'category_pcimage' in 'field list' (1054) #0 /home/jimiwikm/public_html/system/Db/Db.php(1154): IPS\_Db->preparedQuery('/*jimiwikm_siri...', Array) #1 /home/jimiwikm/public_html/system/Patterns/ActiveRecord.php(520): IPS\_Db->update('`ipb_cms_databa...', '`category_pcima...', 'WHERE category_...') #2 /home/jimiwikm/public_html/system/Node/Model.php(2452): IPS\Patterns\_ActiveRecord->save() #3 /home/jimiwikm/public_html/applications/cms/sources/Categories/Categories.php(837): IPS\Node\_Model->save() #4 /home/jimiwikm/public_html/system/Node/Model.php(3274): IPS\cms\_Categories->save() #5 /home/jimiwikm/public_html/system/Node/Controller.php(420): IPS\Node\_Model->saveForm(Array) #6 /home/jimiwikm/public_html/system/Dispatcher/Controller.php(90): IPS\Node\_Controller->form() #7 /home/jimiwikm/public_html/system/Node/Controller.php(69): IPS\Dispatcher\_Controller->execute() #8 /home/jimiwikm/public_html/applications/cms/modules/admin/databases/categories.php(61): IPS\Node\_Controller->execute() #9 /home/jimiwikm/public_html/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\admin\databases\_categories->execute() #10 /home/jimiwikm/public_html/admin/index.php(13): IPS\_Dispatcher->run() #11 {main}
All Astronauts Posted August 16, 2021 Author Posted August 16, 2021 Looking @Jimi Wikman What version did you install? Just to be sure, you are using the application right? There is no code in the newest release that interacts with cms_database_categories other than to copy images to a new table and remove the PCI column from that table. The error you are showing can only appear if you are using some old stuff somehow. Shoot me an account with ACP access (via PM) and I can take a quick look Jimi Wikman 1
Jimi Wikman Posted August 16, 2021 Posted August 16, 2021 Just upgraded and it says 3.0.4 🙂 I'll toss you a PM.
All Astronauts Posted August 16, 2021 Author Posted August 16, 2021 Fixed. I've asked for an accelerated review to get the patch out there. The hitch was in how these are now added to Categories. It gets merged into the object and that's all well and good front-side, but troublesome with saves on the admin side. I got no idea how I missed this 🤷♂️ as it's rather apparent when hit. Effectively a one-line addition to fix. Anyhoo, now that this is set for 4.5/4.6 I'll make a point to look at supporting thumbnail versions of the images and adding an additional field for an array of images which you can then throw at a carousel or something. Steph40 and Jimi Wikman 1 1
Koper74 Posted August 17, 2021 Posted August 17, 2021 (edited) I've got the same error as Jimi after update to 3.0.5. Had to deactivate the plugin to release new records. Re-install didn't help. What can I do? Edited August 17, 2021 by Koper74
All Astronauts Posted August 17, 2021 Author Posted August 17, 2021 @Koper74 Are you on CIC? Regardless, hit the support tool post-install and clear caches just as a first-line check. After that if there are still hitches, I'll need to pop in to your ACP and look (PM me credentials)
All Astronauts Posted August 17, 2021 Author Posted August 17, 2021 And fixed again... Ya know, when IPS let us add fields to IPS application tables, this mod was a dorky simple set-it-and-forget-it thing. Now, ugh. Put simply, I spaced that interacting with records would actually end up re-saving the category as well, and on the front-end, with the background image merged into the Category object that means when those edits/saves occur, it tries to save the Category with refreshed information and hits that background image and tries to save it in the Category table and the field ain't there, etc... I fixed this, ate lunch to give some space, then gave it another run through. I believe I've done all the front-end testing possible. I've hit all the mod actions in record view and category view, plus new records saves, edits, and deletes. Commenting and Reviews on records cleared as well. If this still errors out after this (I don't believe it will but...) I'll need to rip off the band aid and make you guys edit your templates. Instead of $category->pcimage to get at the thing it would be something different. Probably a template plugin like {pci=$category}. Sorry for the hassle. Available when its available (3.0.6) Steph40, Jimi Wikman and Koper74 1 2
Sonya* Posted September 21, 2021 Posted September 21, 2021 Please consider to add stock photos to upload field. I have Pixabay enabled. How it looks like for the page record: How it looks like in your plugin Thank you!
All Astronauts Posted September 21, 2021 Author Posted September 21, 2021 Version 4.0.0 awaiting approval Enables Pixabay Stock Photos for image uploads if you have set all that up in the ACP Sonya* 1
All Astronauts Posted September 22, 2021 Author Posted September 22, 2021 @Sonya* - file approved and available. Yell if there are problems (which would just be escalated to IPS as adding this to PCI was literally just adding 'allowStockPhotos' => true to the form helper) Sonya* 1
Sonya* Posted October 27, 2021 Posted October 27, 2021 Missing generated language string: filestorage__pci_PagesCatImages in ACP (System -> Files -> Storage Settings).
All Astronauts Posted October 27, 2021 Author Posted October 27, 2021 That's gonna be some weirdness on your end. $lang = array( '__app_pci' => "Pages Category Images", 'pciFormTab' => "Category Image", 'category_pcimage' => "Category Image", 'pciInfos' => "You can use this image anywhere the category variable is available to you in Pages templates. Please see the description for this plugin in the Marketplace or visit the support topic for more details.", 'filestorage__pci_PagesCatImages' => "Pages Category Images", 'pci_refreshdatastore' => 'Refresh Pages Category Images Caches', 'pci_refreshdatastore_refreshed' => 'PCI Datastore Cache Refreshed', ); Been there forever. Two cents: Sometimes when installing apps and plugins, if whatever is having time out problems or sync problems (see this a lot on CIC) the install finishes but not correctly (for non-MP installs on CIC I check for S3 file write timeouts in the system logs, if I see them, I know the plugin/app failed the install and repeat until I see that clear) Normally I'd say uninstall and reinstall but you lose your cat images that way so that's a no go. I think you'll have to live with it until a new release is out and hopefully the upgrade catches the existing language string and correctly adds it. Now when that update occurs??? Any suggestions?
Sonya* Posted October 27, 2021 Posted October 27, 2021 1 minute ago, All Astronauts said: Now when that update occurs??? Any suggestions? Sorry, I was IN_DEV
Daniel F Posted October 27, 2021 Posted October 27, 2021 8 minutes ago, All Astronauts said: if whatever is having time out problems or sync problems (see this a lot on CIC) Do you have any further information for this issue?I'm not aware of any reported issues
All Astronauts Posted October 27, 2021 Author Posted October 27, 2021 Years of this. Usually goes along the lines of install plugin, whatever, process completes, no hooks, or no css or ???. Check system logs, see S3 time outs or write fails or, yeah yeah he remembers, hitting S3 write rate limits. So, rinse repeat, until after an install or upgrade (those too of course) I see no system log errors, then I know its fine. NOTE: Have not installed anything on CIC in maybe six months? And no I cannot remember the exact last time this occurred, but has been common for years (way way back). I've always chalked it up to some upstream shenanigans and not an IPS problem per-se. Not sure what you can do other than throw some verification steps after each "process" in the install routine. Tell ya what, the next time this occurs I'll make a note to copypasta the system logs and so on and so forth and loop you in.
Daniel F Posted October 27, 2021 Posted October 27, 2021 40 minutes ago, All Astronauts said: NOTE: Have not installed anything on CIC in maybe six months? That's like 100 internet years?! A lot changed in the last year🤷♂️ Please feel free to send me an email ( my name here + @invisionpower.com ) ASAP you or one of your clients runs into such an issue again.
All Astronauts Posted July 24, 2022 Author Posted July 24, 2022 Almost certainly. I'll test both of these (they are separate things) later today and report back. I have to resubmit the files regardless if there are changes or not to get the Marketplace to flag them up for 4.7 compatibility officially though so that will take some time. My Sharona and LiquidFractal 2
Recommended Posts