There is Configuration form in FilesExtrator however it is not displayed in UI because the processor is not implementing PluginFormInterface.

Patch attached.

Note, also minor change: fixed warning in getExcludedMimes() method due to invalid processing of defaults.

Comments

itsekhmistro created an issue. See original summary.

itsekhmistro’s picture

Status: Active » Needs review
itsekhmistro’s picture

izus’s picture

Status: Needs review » Postponed (maintainer needs more info)

hmm,
i can't reproduce the bug !
i can see the configuration form of all available extration plugins (solr, tika, pdf2text...)
are you sure of using the last versions of search_api_attachments and search_api ?

itsekhmistro’s picture

Hi Ismaeil,

>are you sure of using the last versions of search_api_attachments and search_api ?

Yes, I 'm using the latest dev versions of both modules.

OlgaRabodzei’s picture

StatusFileSize
new123.81 KB
new141.46 KB

Hello!
The topic of the issue is about an index configuration form. I attach screenshots to clarify the problem.
I would be pleased, if you checked this bug one more time.

itsekhmistro’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hi Ismaeil,

Could you recheck this?
Thanks.

edysmp’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

It is working for me.

cmah’s picture

I am getting the following error message when I click on that same checkbox (File attachments shown in the above screencap) ever since I upgraded from search_api 1.0-alpha17 to search_api 1.0-beta2:

Fatal error: Call to undefined method Drupal\search_api\Processor\ProcessorPluginBase::submitConfigurationForm() in /modules/contrib/search_api_attachments/src/Plugin/search_api/processor/FilesExtrator.php on line 456

Is this a related issue?

itsekhmistro’s picture

Yes @chickenofeathers, https://www.drupal.org/node/2773343#comment-11696101 it's a related issue.

You can apply the patch to fix it.

webiator gmbh’s picture

Patch works for me

tuwebo’s picture

Hi, patch works fine for me. Thanks!

lba_emanuel’s picture

StatusFileSize
new864 bytes

Hi,

Maybe patch works but i think it's not solution.
FilesExtrator class extends a wrong class.
Correct class is FieldsProcessorPluginBase and not ProcessorPluginBase. Like this :

class FilesExtrator extends FieldsProcessorPluginBase {

(My patch is for beta3 version)

lba_emanuel’s picture

Sorry,

My patch is for 8.x-1.0-alpha4 and work with a Search API 8.x-1.0-beta3

ekes’s picture

Status: Reviewed & tested by the community » Needs work

Comment #13 rather begs the question here. Related #2784747: File contents field does not appear.

The way processors are now split up in Search API, and how this processor is added as an additional property (the field/s you can add), the configuration should actually with the property (just like Aggregated Fields configuration is).
However, if the processor was a preprocessor of a filefield, then it should be on this page.

I'm guessing that the correct answer, as it would change the type of the field, is that it is an additional property, and the configuration should be on the property.

itsekhmistro’s picture

Status: Needs work » Needs review
--- <html>FilesExtrator.php (<b>15 juil. 2016 12:45:13</b>)</html>
...
@@ -10,7 +10,7 @@

Hi,

Reviewed the patch from comment #13.
First have to mention that the patch format is invalid. And thus the patch can't be applied automatically.

However I have manually applied the changes and tested it on my project.

Good part - the Processor configuration does appear.
Bad part - there are configuration for fields from index and those fields has nothing to do with FileExtractor.

Still, the patch attached initially in the issue https://www.drupal.org/files/issues/search_api_attachments.FileExtractor...
looks better for me. And moreover it address other minor issues in configuration.

wengerk’s picture

I try the following patch FileExtractor-configform.patch and fix it there : FileExtractor-configform-alpha4

It now works properly with an automatic install through composer Eg.

"patches": {
    "drupal/search_api_attachments": {
        "Assert configuration form is displayed": "https://www.drupal.org/files/..../search_api_attachments.FileExtractor-configform-alpha4.patch"
    }
}
ekes’s picture

If the plan is to leave the the processor on this page even though it adds a property, and can't be moved in process order, the top patch is using the correct classes. The FieldsProcessorPluginBase is designed for adding the option to select which fields to operate on.

However, it removes the submit method, which means the configuration excluded_extensions are never converted to the excluded_mimes stored in the configuration. It's these types that are actually used to exclude file types in FilesExtrator::isFileIndexable() via call to FilesExtractor::getExcludedMimes()
To remove the error related to the excluded extension (while saving the mime-type) there is a separate issue #2821884: Default excluded extensions not working correctly

I've pushed a version of the repo with this and other patches from the queue that are RTBC'd to sandbox updated version of Search API Attachments 8.x-1.x.

  • izus committed 5b0193d on 8.x-1.x authored by ekes
    Issue #2773343 by itsekhmistro, lba_emanuel, ekes, wengerk, OlgaRabodzei...
izus’s picture

Status: Needs review » Fixed

Thanks all
this is now merged and will be part of next beta
Thanks again !

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.