Coder Social home page Coder Social logo

file_entity's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

file_entity's Issues

Add EntityInterface to FileEntity

There is an exception about FileEntityNormalizer::getEntityUri($entity) not matching the parent class: ContentEntityNormalizer::getEntityUri(EntityInterface $entity)

Adding EntityInterface to the FileEntityNormalizer method isn't enough though, since FileEntity doesn't implement the EntityInterface yet.

Test fails

I had a look at the test fails and started fixing them, but I currently have some problems with my development environment which make the tests take ages.

It's mosty just updating the test asserts (the exceptions are now unexpected :D), the xpath calls are all empty and one config (views.view.past_event_log) needs a dependency on the víews module.

Fatal error when replacing a file

When updating a file, we have a fatal error:

Drupal\Core\Entity\EntityStorageException: 'thumbnail' not found in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 757 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Entity\Query\Sql\Tables->addField('thumbnail.fid', 'INNER', NULL)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object)
Drupal\Core\Entity\Query\Sql\Query->compile()
Drupal\Core\Entity\Query\Sql\Query->execute()
Drupal\file_entity\Entity\FileEntity->updateImageFieldDimensions()
Drupal\file_entity\Entity\FileEntity->postSave(Object, 1)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1)
Drupal\Core\Entity\EntityStorageBase->save(Object)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object)
Drupal\Core\Entity\Entity->save()

Property "display" is unknown when normalizing ImageItem fields

With Beta 16 and File Entity at 4654bdf

I'm hitting this line in TypedDataManager

throw new \InvalidArgumentException("Property $property_name is unknown.");

Wrapping these two lines in a check for ImageItem fixes the issue.

if (!$field_item instanceof ImageItem) {
  $data['_embedded'][$field_uri][0]['display'] = $field_item->get('display')->getValue();
  $data['_embedded'][$field_uri][0]['description'] = $field_item->get('description')->getValue();
}

The issue is that the normalizer is being applied for ImageItem which does not have those fields.

Why are route paths unquoted in File Entity but not in say, the Node module?

Ran into an issue which I posted about first over here:

http://drupal.stackexchange.com/questions/177519/route-parameter-upcasting-and-route-access

Finally realized that having the path as a quoted string was not working. But now, why is it that File Entity and now my custom module has to have non quoted strings as paths for parameter upcasting to work? Is this a core problem or did I miss something? The node module has all of its paths quoted, with parameters. If there is a convention or reason to it I would like to know.

Fix batch deletion of files.

Deleting more than one file on admin/content/files by checking the box, selecting 'Delete file' and hitting 'Apply' is broken. No idea why yet.

File Entity fields are not available in REST export

  1. Install File Entity
  2. Add a custom field to the image entity
  3. Add an image to node 1
  4. REST GET on node/1

In the image field, the custom fields and the values for alt and title don't appear.

Maybe someone can give a hint, how to fix this, then i will try to create a patch.

Trying to install on beta3 results in fatal error

Fatal error: Call to a member function getConfigDependencyName() on a non-object in core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 165

Stack track:

PHP Fatal error:  Call to a member function getConfigDependencyName() on a non-object in web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php on line 165
PHP Stack trace:
1. {main}() web/index.php:0
2. Drupal\\Core\\DrupalKernel->handle() web/index.php:22
3. Stack\\StackedHttpKernel->handle() web/core/lib/Drupal/Core/DrupalKernel.php:563
4. Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle() vendor/stack/builder/src/Stack/StackedHttpKernel.php:23
5. Drupal\\Core\\StackMiddleware\\PageCache->handle() web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:58
6. Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle() web/core/lib/Drupal/Core/StackMiddleware/PageCache.php:52
7. Symfony\\Component\\HttpKernel\\HttpKernel->handle() web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:53
8. Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw() vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:66
9. call_user_func_array() vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:145
10. Drupal\\Core\\Controller\\HtmlPageController->content() vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:145
11. Drupal\\Core\\Controller\\HtmlPageController->getContentResult() web/core/lib/Drupal/Core/Controller/HtmlPageController.php:53
12. call_user_func_array() web/core/lib/Drupal/Core/Controller/HtmlPageController.php:76
13. Drupal\\Core\\Controller\\FormController->getContentResult() web/core/lib/Drupal/Core/Controller/HtmlPageController.php:76
14. Drupal\\Core\\Form\\FormBuilder->buildForm() web/core/lib/Drupal/Core/Controller/FormController.php:81
15. Drupal\\Core\\Form\\FormBuilder->processForm() web/core/lib/Drupal/Core/Form/FormBuilder.php:266
16. Drupal\\Core\\Form\\FormSubmitter->doSubmitForm() web/core/lib/Drupal/Core/Form/FormBuilder.php:487
17. Drupal\\Core\\Form\\FormSubmitter->executeSubmitHandlers() web/core/lib/Drupal/Core/Form/FormSubmitter.php:56
18. call_user_func_array() web/core/lib/Drupal/Core/Form/FormSubmitter.php:116
19. Drupal\\system\\Form\\ModulesListForm->submitForm() web/core/lib/Drupal/Core/Form/FormSubmitter.php:116
20. Drupal\\Core\\Extension\\ModuleHandler->install() web/core/modules/system/src/Form/ModulesListForm.php:508
21. Drupal\\Core\\Config\\ConfigInstaller->installDefaultConfig() web/core/lib/Drupal/Core/Extension/ModuleHandler.php:849
22. Drupal\\Core\\Config\\ConfigInstaller->createConfiguration() web/core/lib/Drupal/Core/Config/ConfigInstaller.php:125
23. Drupal\\Core\\Entity\\Entity->save() web/core/lib/Drupal/Core/Config/ConfigInstaller.php:233
24. Drupal\\Core\\Config\\Entity\\ConfigEntityStorage->save() web/core/lib/Drupal/Core/Entity/Entity.php:325
25. Drupal\\Core\\Entity\\EntityStorageBase->save() web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:232
26. Drupal\\Core\\Entity\\EntityDisplayBase->preSave() web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:395
27. Drupal\\Core\\Config\\Entity\\ConfigEntityBase->preSave() web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php:150
28. Drupal\\Core\\Entity\\EntityDisplayBase->calculateDependencies() web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:309

ReST GET expected result at file/{fid}

Hi there. Please tell me if you're not answering questions here ;)

I've just installed the updated version with D8 HEAD (which is now installing well thank you).

I've:

  • Enabled File Entity, HAL, Serialisation and ReST
  • Configured permissive permissions for ReST
  • Added a File entity to Article
  • Added an Article with a file (a text file)
  • Browsed (postman) to node/1 with application/hal+json (snippet below)
  • Browsed to file/1 with application/hal+json

Expected result

  • Some sort of JSON structure for a file (so that I can replicate that with a POST)

Actual result

  • 406 Not Acceptable
{
    "message": "Not Acceptable.",
    "supported_mime_types": [
        "text/html",
        "application/vnd.drupal-ajax",
        "application/vnd.drupal-dialog",
        "application/vnd.drupal-modal"
    ]
}

Is this expected?

node/{nid} snippet

{
    "_links": {
// ...
        "http://local.d8.example.com/rest/relation/node/article/field_file": [
            {
                "href": "http://local.d8.example.com/file/1"
            }
        ]
    },
// ...
    "_embedded": {
// ...
        "http://local.d8.example.com/rest/relation/node/article/field_file": [
            {
                "_links": {
                    "self": {
                        "href": "http://local.d8.example.com/file/1"
                    },
                    "type": {
                        "href": "http://local.d8.example.com/rest/type/file/document"
                    }
                },
                "uuid": [
                    {
                        "value": "e1438f29-f109-4e55-a660-967eb2bb5a0e"
                    }
                ],
                "display": "1",
                "description": ""
            }
        ]
    },
// ...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.