I'm trying to make a really simple module to add the Category Thumbnail back to Magento 2.2.1 and having a real time with it. I've been working on this simple issue for many hours, and read many pages with no real progress.
Here's my app/code/Tridium/Thumbnail/etc/adminhtml/routes.xml file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="thumbnail" frontName="thumbnail">
<module name="Tridium_Thumbnail" />
</route>
</router>
</config>
And my app/code/Tridium/Thumbnail/view/adminhtml/ui_component/category_form.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="content">
<field name="thumbnail">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">string</item>
<item name="source" xsi:type="string">category</item>
<item name="label" xsi:type="string" translate="true">Category Thumbnail</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="formElement" xsi:type="string">fileUploader</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
<item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
<item name="required" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="number">40</item>
<item name="uploaderConfig" xsi:type="array">
<item name="url" xsi:type="url" path="thumbnail/image/upload"/>
</item>
</item>
</argument>
</field>
</fieldset>
</form>
The controller is at app/code/Tridium/Thumbnail/Controller/Adminhtml/Image/Upload.php.
The thumbnail image field appears just fine on the Category Form, but it will not upload because the URL continually throws a 404.
The URL it is attempting to upload the file to looks like:
<admin_path>/thumbnail/image/upload
Please, any thoughts about this?
I've looked around to see if there is a way to output all the parsed routes, but there doesn't seem to be. It seems that would be a really helpful addition to the magento binary...
Upload.php