Fixed Rebuild Search Index field does not use a phrase key

Onimua

Well-known member
Tools > Rebuild Caches > Rebuild Search Index uses the content type to create the phrases for the list instead of using a content type phrase key. Not sure if this is a bug or suggestion. :unsure:
 
Tools > Rebuild Caches > Rebuild Search Index uses the content type to create the phrases for the list instead of using a content type phrase key. Not sure if this is a bug or suggestion. :unsure:
Are you saying that this is a problem because we can't name content types the same as a pre-existing phrase, so it would be better to be something like:
Rich (BB code):
public function actionRebuild()
{
$this->assertAdminPermission('rebuildCache');
 
/* @var $searchModel XenForo_Model_Search */
$searchModel = XenForo_Model::create('XenForo_Model_Search');
 
$searchContentTypeOptions = array();
foreach ($searchModel->getSearchContentTypes() AS $contentType => $null)
{
$searchContentTypeOptions[$contentType] = new XenForo_Phrase('content_type_' . $contentType);
}
 
$viewParams = array(
'searchContentTypes' => $searchContentTypeOptions
);
 
return $this->responseView('XenForo_ViewAdmin_Tools_Rebuild', 'tools_rebuild', $viewParams);
}
?

I guess this would have to be "fixed" in 1.2 (not 1.1.4), otherwise it would mess up too many add-ons? It would certainly mess up a few of my add-ons.
 
It shouldn't. Phrase keys were adds later into XF for the attachment handler with no issue. Here it looks like a phrase key just needs to be added to the search handler.
 
It shouldn't. Phrase keys were adds later into XF for the attachment handler with no issue. Here it looks like a phrase key just needs to be added to the search handler.
When were phrase keys added for the attachment handler? I guess if that was done on a minor release, then that sets the precedent.

I see that the function for the Attachment Handler returns 'unknown' if no phrase is set, and I wouldn't have thought that as a result of a minor release I would have to update all of my add-ons that add content types. But, if needs must...
 
Yeah, a change to this would need to be a 1.2 thing. The better approach would be to handle it like the attachment handler, by the search data handlers returning a phrase key.
 
Top Bottom