It would be useful if the phpBB3 import script could take these comments and assign them as alt text to the image they are paired with, which would then appear as you hover over the image in Discourse.
Ah! Since I know nothing about Ruby on Rails - and, I’m requesting an enhancement to the phpBB import script - I’d like to request an additional enhancement as described here. It would be useful if, when the script reports a date/time error with a post, that it also reports the phpBB post_id for debugging purposes.
It’s not immediately clear how to go about doing what you ask, but I spent a few minutes and there isn’t a very satisfactory solution that seems feasible.
There’s nowhere in the upload record for the caption, and I don’t see an obvious way to go backward from the Upload. . . a possibility might be to put the comment in as the filename and then somehow later pull that back out as the caption. Yeah. That’s about the best you could do, encode that caption as the filename, which would make it show up on mouseover and such. If you wanted, you could then do something else, like get filenames that include a caption and then stick that into the html somehow.
Admittedly, I know nothing about RoR, or even about postgres. But, when you markup an image with alt text, it’s stored in the postgres database in association with that image. What is it about the import script, that prevents that assignment? Certainly, the comment is accessible in MySQL.
Thank you! Do you want to qualify the assignment based on MIME type? (I was unable to attach a phpBB comment to a .mp4; while I was able to a .gif, it did not appear on hover.)
This could be useful, but I worked on a new way of adding the comment directly to the post’s raw. I believe it’s safer that way to handle all types of files.
Would you be able to test these changes with your dataset? I tested locally but would love your feedback before moving forward with a PR.
I’d be happy to test, but… Do I have to purge my test environment and repeat? Claude.ai walked my through the installation process, I’m a docker Newbie - and even so, there was a lot of errors along the way.
If you can outline a way for me to readily test, I’d be happy to give it a go.
Nice work! I poked at the code and couldn’t find that.
Yes. You’ll need to wipe the database and run again. The importer skips already-imported data, so you’ll need to re-import everything to try it out. Looks like it should work, though!
OK - well, the attachments are still in place, as is the MySQL database. It took several hours to run, but I’ll have Claude walk me through it and report back.
Sure, I can help you. No need to change your installation. The easy way:
Take a backup of your site and store it safely. This will protect you from losing your work.
Reset your site:
# Enter the site’s container
cd /var/discourse
./launcher enter <your-container-name>
# Reset database
bundle exec rake db:drop
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
# Exit the container
exit
# Rebuild the container just to be sure everything is in place
./launcher rebuild <your-container-name>
Modify the files with the new code. You can use a cli text editor or open your container using ssh in your favorite text editor.
Setup the settings.yml and run the importer again.
To get back to your previous state, you simply restore the backup you took at the beginning:
./launcher enter <your-container-name>
discourse enable restore
discourse restore <your-backup-filename>
Oh yeah! While we’re at it, is it easy enough to modify the script to report the phpBB post_id that’s being processed, when the date/time issue is reported?