What's new
[XB] Change Attachment Name

[XB] Change Attachment Name [Paid] 2.0.6 Patch Level 4

You must log in or register to purchase ($20.00)

Painbaker

Administrator
Would it be possible to not include the attachment extension when automatically editing the alt attribute?

View attachment 2956
This can be disabled in options
"Keep extension in new filename for ALT attribute for renamed inserted attachments"

I have noticed that sometimes the alt attribute is not changed when renaming the attachment, it shows the previous name, could you take a look at it? @Painbaker
Should be fixed in last patch
 
I think the error continues :(
Try checking the browser console when this happens - if there are any errors there.

It is also possible that attribute is not updated because of addon conflict due to custom parameters. The attributes in the message is searched by a regular expression, but it may not work in your case.
Please send me what your ATTACH tag looks like in problem messages.
 
Try checking the browser console when this happens - if there are any errors there.

It is also possible that attribute is not updated because of addon conflict due to custom parameters. The attributes in the message is searched by a regular expression, but it may not work in your case.
Please send me what your ATTACH tag looks like in problem messages.

I've sent you a private message with the details. I've also tried sending you a video showing the error, but it won't let me attach an mp4.
 
Hi Painbaker,

I'm very interested in this add-on but I have a few questions.

On my forum images on the board are automatically mirrored in the gallery. With this add-on, if I change the filename on the board, in a post, will the filename of the mirrored image in the gallery also change, or does that need to be done separately?

Having the ability to change file names in the Attachment Browser is very nice indeed! Are batch edits possible in there? That would be bloody brilliant so that when someone posts 8 pictures of a red squirrel I don't have to do every single one of them separately.

Also, I'm a bit concerned about conflicting add-ons. As you know I have your EXIF add-on, and I also have Naz' "Mirrored Images" add-on that converts embeds to attachments. I'm just a bit worried the three of them won't play nice together. What do you think?
 
On my forum images on the board are automatically mirrored in the gallery. With this add-on, if I change the filename on the board, in a post, will the filename of the mirrored image in the gallery also change, or does that need to be done separately?
At the moment, the add-on only changes the attachment name, not the content associated with it. I will add this in the next update.

Having the ability to change file names in the Attachment Browser is very nice indeed! Are batch edits possible in there? That would be bloody brilliant so that when someone posts 8 pictures of a red squirrel I don't have to do every single one of them separately.

There is no batch update for attachments in XF out of the box to add this feature it based on this.
I will look into what can be done within the scope of my add-on.


Also, I'm a bit concerned about conflicting add-ons. As you know I have your EXIF add-on, and I also have Naz' "Mirrored Images" add-on that converts embeds to attachments. I'm just a bit worried the three of them won't play nice together. What do you think?
If this third-party add-on converts images into regular attachments, I don't think there should be any conflicts here.
 
At the moment, the add-on only changes the attachment name, not the content associated with it. I will add this in the next update.
That would be great.

There is no batch update for attachments in XF out of the box to add this feature it based on this.
I will look into what can be done within the scope of my add-on.
That would be really awesome.

If this third-party add-on converts images into regular attachments, I don't think there should be any conflicts here.
Okay, then I'm going to just download it and install it, see how it goes.
 
I see that the license is just for one year. Does that mean that after I year I can't use it any more unless I pay the renewal price? Or does it relate to possible updates?
 
I see that the license is just for one year. Does that mean that after I year I can't use it any more unless I pay the renewal price? Or does it relate to possible updates?
The license expiring only affects your ability to download new updates
 
Hi Painbaker!

I've been very busy making changes to my forum but today I installed the add-on. It works just fine and it's great. But I am getting the odd server error, see below.

I thought I'd report it.

Code:
    ErrorException: Template error: [E_USER_WARNING] Cannot call method isIgnoring on a non-object (NULL) src/XF/Template/Templater.php:1267

    Generated by: Levina de Ruijter 18 January 2026 at 21:28

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', 's...', 1267)
#1 src/XF/Template/Templater.php(1267): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l1/s0/public/bb_code_tag_quote.php(11): XF\Template\Templater->method(NULL, 'isIgnoring', Array)
#3 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#4 src/XF/BbCode/Renderer/Html.php(1270): XF\Template\Templater->renderTemplate('bb_code_tag_quo...', Array)
#5 src/XF/BbCode/Renderer/Html.php(1214): XF\BbCode\Renderer\Html->getRenderedQuote('Wojtek the Sold...', 'Levina de Ruijt...', Array, Array)
#6 src/XF/BbCode/Renderer/Html.php(356): XF\BbCode\Renderer\Html->renderTagQuote(Array, 'Levina de Ruijt...', Array, Array, Object(s9e\MediaSites\XF\BbCode\Renderer\Html))
#7 src/addons/s9e/MediaSites/XF/BbCode/Renderer/Html.php(17): XF\BbCode\Renderer\Html->renderTag(Array, Array)
#8 src/XF/BbCode/Traverser.php(63): s9e\MediaSites\XF\BbCode\Renderer\Html->renderTag(Array, Array)
#9 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#10 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(XF\BbCode\RuleSet), Array)
#11 src/XF/SubContainer/BbCode.php(236): XF\BbCode\Traverser->render('[QUOTE="Levina ...', Object(XF\BbCode\Parser), Object(XF\BbCode\RuleSet), Array)
#12 src/XF/Template/Templater.php(2619): XF\SubContainer\BbCode->render('[QUOTE="Levina ...', 'html', 'post', Object(TickTackk\ChangeContentOwner\XF\Entity\Post), Array)
#13 src/XF/Template/Templater.php(1219): XF\Template\Templater->fnBbCode(Object(SV\StandardLib\XF\Template\Templater), false, '[QUOTE="Levina ...', 'post', Object(TickTackk\ChangeContentOwner\XF\Entity\Post))
#14 src/addons/PB/ChangeAttachmentName/XF/Entity/Post.php(11): XF\Template\Templater->func('bb_code', Array)
#15 src/addons/PB/ChangeAttachmentName/ControllerPlugin/Attachment.php(55): PB\ChangeAttachmentName\XF\Entity\Post->getAttachmentRenamePreviewMessage()
#16 src/addons/PB/ChangeAttachmentName/XF/Admin/Controller/Attachment.php(21): PB\ChangeAttachmentName\ControllerPlugin\Attachment->actionRename(Object(XFMG\XF\Entity\Attachment), '/admin.php?atta...')
#17 src/XF/Mvc/Dispatcher.php(362): PB\ChangeAttachmentName\XF\Admin\Controller\Attachment->actionRename(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Attachment', 'Rename', Object(XF\Mvc\RouteMatch), Object(PB\ChangeAttachmentName\XF\Admin\Controller\Attachment), NULL)
#19 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(PB\ChangeAttachmentName\XF\Admin\Controller\Attachment), NULL)
#20 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#22 src/XF.php(806): XF\App->run()
#23 admin.php(15): XF::runApp('XF\\Admin\\App')
#24 {main}

Request state

array(4) {
  ["url"] => string(200) "/admin.php?attachments/img_6643_-copy-webp.76454/rename&_xfResponseType=json&_xfWithData=1&_xfRequestUri=%2Fadmin.php%3Fattachments%2F%26page%3D9&_xfToken=1768767867%2C7b90b028183adde2e2dbc3b4463a094a"
  ["referrer"] => string(62) "https://photographers-on-the.net/admin.php?attachments/&page=9"
  ["_GET"] => array(5) {
    ["attachments/img_6643_-copy-webp_76454/rename"] => string(0) ""
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(30) "/admin.php?attachments/&page=9"
    ["_xfToken"] => string(43) "1768767867,7b90b028183adde2e2dbc3b4463a094a"
  }
  ["_POST"] => array(0) {
  }
}
 
Also, I'm wondering if it would be possible to position the little pencil on the thumbnails elsewhere, say in the lower left or lower right corner. It is now frightfully close to the trash bin and sure enough I just accidentally deleted an image. And once gone, it's gone, can't retrieve it.
 
Or a popup to confirm the deletion.
Yes, that would work too. Right now it's too easy to delete a pic.

And there is another problem I ran into today. I received DM's from members whose pics were gone from their posts. Turned out the thumbnails were still there, but the photos were missing from the post, so I just inserted them again. It happened in just a few posts, but this is bad. I can't edit the titles and then having to check if the images are still present in the posts.
 
Yes, that would work too. Right now it's too easy to delete a pic.

And there is another problem I ran into today. I received DM's from members whose pics were gone from their posts. Turned out the thumbnails were still there, but the photos were missing from the post, so I just inserted them again. It happened in just a few posts, but this is bad. I can't edit the titles and then having to check if the images are still present in the posts.

Now that you mention it, it's happened to me too, but it was during an import; I didn't think it was related to the add-on. Hopefully, @Painbaker will fix it.
 
Hi Painbaker!

I've been very busy making changes to my forum but today I installed the add-on. It works just fine and it's great. But I am getting the odd server error, see below.

I thought I'd report it.

Code:
    ErrorException: Template error: [E_USER_WARNING] Cannot call method isIgnoring on a non-object (NULL) src/XF/Template/Templater.php:1267

    Generated by: Levina de Ruijter 18 January 2026 at 21:28

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, '[E_USER_WARNING...', 's...', 1267)
#1 src/XF/Template/Templater.php(1267): trigger_error('Cannot call met...', 512)
#2 internal_data/code_cache/templates/l1/s0/public/bb_code_tag_quote.php(11): XF\Template\Templater->method(NULL, 'isIgnoring', Array)
#3 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#4 src/XF/BbCode/Renderer/Html.php(1270): XF\Template\Templater->renderTemplate('bb_code_tag_quo...', Array)
#5 src/XF/BbCode/Renderer/Html.php(1214): XF\BbCode\Renderer\Html->getRenderedQuote('Wojtek the Sold...', 'Levina de Ruijt...', Array, Array)
#6 src/XF/BbCode/Renderer/Html.php(356): XF\BbCode\Renderer\Html->renderTagQuote(Array, 'Levina de Ruijt...', Array, Array, Object(s9e\MediaSites\XF\BbCode\Renderer\Html))
#7 src/addons/s9e/MediaSites/XF/BbCode/Renderer/Html.php(17): XF\BbCode\Renderer\Html->renderTag(Array, Array)
#8 src/XF/BbCode/Traverser.php(63): s9e\MediaSites\XF\BbCode\Renderer\Html->renderTag(Array, Array)
#9 src/XF/BbCode/Traverser.php(39): XF\BbCode\Traverser->renderSubTree(Array, Array)
#10 src/XF/BbCode/Traverser.php(22): XF\BbCode\Traverser->renderAst(Array, Object(XF\BbCode\RuleSet), Array)
#11 src/XF/SubContainer/BbCode.php(236): XF\BbCode\Traverser->render('[QUOTE="Levina ...', Object(XF\BbCode\Parser), Object(XF\BbCode\RuleSet), Array)
#12 src/XF/Template/Templater.php(2619): XF\SubContainer\BbCode->render('[QUOTE="Levina ...', 'html', 'post', Object(TickTackk\ChangeContentOwner\XF\Entity\Post), Array)
#13 src/XF/Template/Templater.php(1219): XF\Template\Templater->fnBbCode(Object(SV\StandardLib\XF\Template\Templater), false, '[QUOTE="Levina ...', 'post', Object(TickTackk\ChangeContentOwner\XF\Entity\Post))
#14 src/addons/PB/ChangeAttachmentName/XF/Entity/Post.php(11): XF\Template\Templater->func('bb_code', Array)
#15 src/addons/PB/ChangeAttachmentName/ControllerPlugin/Attachment.php(55): PB\ChangeAttachmentName\XF\Entity\Post->getAttachmentRenamePreviewMessage()
#16 src/addons/PB/ChangeAttachmentName/XF/Admin/Controller/Attachment.php(21): PB\ChangeAttachmentName\ControllerPlugin\Attachment->actionRename(Object(XFMG\XF\Entity\Attachment), '/admin.php?atta...')
#17 src/XF/Mvc/Dispatcher.php(362): PB\ChangeAttachmentName\XF\Admin\Controller\Attachment->actionRename(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Attachment', 'Rename', Object(XF\Mvc\RouteMatch), Object(PB\ChangeAttachmentName\XF\Admin\Controller\Attachment), NULL)
#19 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(PB\ChangeAttachmentName\XF\Admin\Controller\Attachment), NULL)
#20 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#22 src/XF.php(806): XF\App->run()
#23 admin.php(15): XF::runApp('XF\\Admin\\App')
#24 {main}

Request state

array(4) {
  ["url"] => string(200) "/admin.php?attachments/img_6643_-copy-webp.76454/rename&_xfResponseType=json&_xfWithData=1&_xfRequestUri=%2Fadmin.php%3Fattachments%2F%26page%3D9&_xfToken=1768767867%2C7b90b028183adde2e2dbc3b4463a094a"
  ["referrer"] => string(62) "https://photographers-on-the.net/admin.php?attachments/&page=9"
  ["_GET"] => array(5) {
    ["attachments/img_6643_-copy-webp_76454/rename"] => string(0) ""
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(30) "/admin.php?attachments/&page=9"
    ["_xfToken"] => string(43) "1768767867,7b90b028183adde2e2dbc3b4463a094a"
  }
  ["_POST"] => array(0) {
  }
}
Should be fixed in last update

Also, I'm wondering if it would be possible to position the little pencil on the thumbnails elsewhere, say in the lower left or lower right corner. It is now frightfully close to the trash bin and sure enough I just accidentally deleted an image. And once gone, it's gone, can't retrieve it.


I added an option to put the edit button here:

1769109509808.webp
options.webp

Yes, that would work too. Right now it's too easy to delete a pic.

And there is another problem I ran into today. I received DM's from members whose pics were gone from their posts. Turned out the thumbnails were still there, but the photos were missing from the post, so I just inserted them again. It happened in just a few posts, but this is bad. I can't edit the titles and then having to check if the images are still present in the posts.

I believe that the text of these messages contained incorrect BB codes ATTACH with attributes in the wrong order.
I made a change in the latest patch to handle such cases correctly.
 
I think an important feature would be the ability to rename all attachments via cron using variables like those in the "Auto Title & Alt Image Attributes" add-on.

This way, thousands of attachments could be renamed, for example: {site} {title} {date}


1769937203851.webp
 
@Painbaker The error that was showing the extension is still appearing in XFMG.

I edited a name from the thread. In the thread, it displays correctly without the extension, but in XFMG, it appears with .wepb.
 
@PhineasD That's funny, it's exactly the opposite on my forum. The extension does show in the filename in the thread and in the metadata in the Gallery, which I think is helpful for the good bots so they know it's an image. But it is gone from the XF title field so you get a nice clean URL. For me this is perfect.

One thing is that when I post an image and change the filename, then submit the post, the extension shows both in the thread and in the XF title field. But if I edit my post and change the name, the extension shows in the thread but not in the XF title field. It's not a problem for me though. I just submit my post, click on edit, change the filename, cancel. And now there's no extension in the Gallery title field.
 
What I'm looking for is that when I edit the name of an attachment and I have enabled the option to not show the extension, in XFMG it doesn't show the page title with the name and the extension.
 
Back
Top