Jump to content

Recommended Posts

Is this the right place...... Hope so if not please don't be offended 

I have taken over a forum (for now anyhow). And got the site up but keep getting this error when ever I try to open any of the comments 

InvalidArgumentException: No attachment handler found for content type 'post' in src/XF/Repository/Attachment.php at line 18

 

No idea wht it means,  any advice ...... If I'm in the wrong place please advise me.

Thanks for looking 

"

Educated guess:  Xenforo?  

From what I can see it's a commercial closed source product.  It seems a day doesn't go by where I find out about some php based product I've never heard of, that has a business built around it.

If my suspicion is correct, there is very little help anyone here can offer, as it is unlikely anyone has any experience with it.  My best advice would be to find an experienced PHP dev, and probably one who has familiarity with Xenforo.  Your best chance of finding such a person, whether it be free advice or someone you can pay to help you figure out your issue, is going to be on the Xenforo Community forums.

As requinix already stated, if it is not xenforo, the first thing we need to know is what forum software you are using.  Be candid and provide details if you want further help.  Things like the os of the server, version of php, and version of the software being run are important.  

  • Thanks 1

The site was up and running fine, and from the outside all functions....  But when logged in clicking on any thread returns an error message. 

Twas built in XenForo. 

 

The complex message can be seen in the is bellow.

 

InvalidArgumentException: No attachment handler found for content type 'post' in src/XF/Repository/Attachment.php at line 18

XF\Repository\Attachment->getEditorData() in src/XF/Pub/Controller/Thread.php at line 1752

XF\Pub\Controller\Thread->getReplyAttachmentData() in src/XF/Pub/Controller/Thread.php at line 189

XF\Pub\Controller\Thread->actionIndex() in src/addons/Andy/SimilarThreads/XF/Pub/Controller/Thread.php at line 16

Andy\SimilarThreads\XF\Pub\Controller\Thread->actionIndex() in src/XF/Mvc/Dispatcher.php at line 352

XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 263

XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115

XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57

XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2351

XF\App->run() in src/XF.php at line 517

XF::runApp() in index.php at line 20

 

It was a car community forum non commercial 

I have also aattached screen shot.

Everything looks normal from outside

 

 

Screenshot_20220330-193237.png

So we have established that my suspicion was correct.  You have a problem with a commercial product that we have no way of looking at.

It does seem that this is related to an "attachment" processing addon, but I could also be wrong about that.  Either way, without the actual source, or access to your server, there isn't some magical generic fix that is going to make things work.  

The stack dump you attached should be looked at in reverse.  So the first item was the last method run.  It was running the getEditorData() method in the Attachment class, and something the code is doing at around line 1752 triggered the exception.  The message indicates that there is a "handler" architecture involved, and whatever is being read has the "post" content type, which is likely some internal classification of data inside the application/database.  The code is expecting there to be a handler (ie. some code that will be able to figure out what to do next) and the forum software is not finding any handler that's been registered within the application to be able to process further, so it throws the exception and exits.  

This is why I suspect that the old forum might have been using some sort of plugin, and possibly your issue is that you don't have that plugin installed and configured with whatever Xenforo installation you have now.

Also as I stated in my prior message, the forum version and PHP version you are running could very well be at the heart of the problem, as it's possible if you are running an older version of their forum software, that there are techniques and syntax that don't work anymore with a more current version of PHP, or as I surmised, there could also be a plugin missing.  

I don't think there's anything more I can suggest for you, other than to seek help on the xenforo and Xfrocks communities.  I hope this helps you ;)

  • Thanks 1
14 hours ago, Cheagavara said:

That does help a lot, thank you . The XenForo version is 2.2.4 and PHP is the latest (confirmed with host) and when test are run it comes back that the PHP version is compatible 

It seems very likely that it is a missing plugin that handled message attachments.  

On 4/1/2022 at 2:47 AM, gizmola said:

It seems very likely that it is a missing plugin that handled message attachments.  

Thank you .... Now to find the plugin. The person who set the forum up and run it for the owner has disappeared,  just gone, and things started going wrong straight away. Could he have deleted the plugin? 

The plugin issue is just a theory.  I have no experience with XenForo, so all I can offer is an educated guess.  If the person had some sort of axe to grind with the forum, then I guess that could be the case, but I thought that you moved things to a new server, so perhaps there is a separate installation for plugins that needed to be done.  

18 hours ago, gizmola said:

The plugin issue is just a theory.  I have no experience with XenForo, so all I can offer is an educated guess.  If the person had some sort of axe to grind with the forum, then I guess that could be the case, but I thought that you moved things to a new server, so perhaps there is a separate installation for plugins that needed to be done.  

No it's not been moved , the person that owns the forum pays for the hosting and owns the domain. The person who was running it for him has been locked out now. The forum and database is "as was" when the person left and a complete reinstall from the server was carried out and still the same results. Unfortunately my knowledge is more html than pop so I'm stumbling around a bit just trying to help out as its a non profit forum for a group of car enthusiast. 

Just out of interest,  as a guess,  if I disabled all of the plugins should the forum still run in the original XenForo temple? 

Everyone's input is apriciated a lot 

any help with what this means?

 

 '$isFirstPostAndPinned' (T_VARIABLE) 

 

full line

 

 syntax error, unexpected '$isFirstPostAndPinned' (T_VARIABLE) in src/XF/ControllerPlugin/Thread.php at line 21

 

thank to all

Edited by Cheagavara
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.