Skip to content

Releases: RESTful-Drupal/restful

7.x-2.4

17 Dec 13:25
Compare
Choose a tag to compare

[BUGFIX] Allow OPTIONS requests with access token

2cdf7aa by Mateu Aguiló Bosch (G)

Add the OPTIONS HTTP method to the allowed methods

:100644 100644 f552044... 7782658... M  modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php

[FEATURE] Performance improvements

c2d0a50 by Mateu Aguiló Bosch (G)

Add minor improvements to methods that are called a lot. A small
bit can add up when called tens of thousands of times.

:100644 100644 a9e4a9e... 9cfda2a... M  src/Formatter/FormatterManager.php
:100644 100644 62d300e... 04f1baf... M  src/Plugin/resource/DataProvider/DataProvider.php
:100644 100644 1cb8f67... 10d029e... M  src/Plugin/resource/Field/ResourceField.php
:100644 100644 cb9dcb0... 31b43d2... M  src/Plugin/resource/Field/ResourceFieldEntity.php
:100644 100644 d446974... 1e203a7... M  src/Resource/ResourceManager.php
:100644 100644 1c8b71a... b96ebd2... M  tests/RestfulAuthenticationTestCase.test
:100644 100644 6492168... 8f2bdd0... M  tests/RestfulCreateEntityTestCase.test
:100644 100644 e4d9ab2... bb6a98e... M  tests/RestfulReferenceTestCase.test

[FEATURE] Introduce fast cache clear

0abdfe3 by Mateu Aguiló Bosch (G)

Avoid entity related slowness given that those features are not
leveraged by core. Allow the user to re-enable them if necessary.

:100644 100644 99409b9... bc6a21f... M  .travis.yml
:100644 100644 66fe45a... b5a77a7... M  restful.admin.inc
:100644 100644 e5a64dd... 7d7e6ed... M  restful.entity.inc
:100644 100644 576a07f... f5fe7ec... M  restful.module
:100644 100644 5b8d6d9... 2b0465a... M  src/RenderCache/Entity/CacheFragmentController.php

[BUGFIX] Remove unprocesable entities from embedded lists

2e9e30e by Mateu Aguiló Bosch (G)

Return NULL if the embedded entity does not exist

:100644 100644 1478305... cb9dcb0... M  src/Plugin/resource/Field/ResourceFieldEntity.php
:100644 100644 3357563... d059281... M  tests/RestfulJsonApiTestCase.test

[FEATURE] Allow a generic field reference

d84bbf3 by Mateu Aguiló Bosch (G)

This includes adding support for arbitrary fields that return an ID
to be used as a reference as long as they include the corresponding
'resource' information.

:100644 100644 0ad5f82... ec1e7b3... M  src/Plugin/formatter/Formatter.php
:100644 100644 d53d726... 1cb8f67... M  src/Plugin/resource/Field/ResourceField.php
:100644 100644 81b856d... dd00968... M  src/Plugin/resource/Field/ResourceFieldEntityReference.php
:000000 100644 0000000... 5cd60ae... A  src/Plugin/resource/Field/ResourceFieldReference.php
:100644 100644 811781a... 3357563... M  tests/RestfulJsonApiTestCase.test
:000000 100644 0000000... e8469e6... A  tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_8.php

[FEATURE] More semantic error codes on access check

3d94c6e by Antonio De Marco (G)

If a request is denied access via a RESTful exception do not discard
the error code. Instead return a well formatted error response.

:100644 100644 e101652... 576a07f... M  restful.module
:100644 100644 63b7bcb... caa7caa... M  tests/RestfulCsrfTokenTestCase.test
:100644 100644 5d8d385... a21c0a7... M  tests/RestfulRenderCacheTestCase.test

[CLEANUP] Error message cleanup (part 2)

8a87def by Mateu Aguiló Bosch (G)

An extra typo was left from the last commit.

:100644 100644 4720628... 1b0129a... M  src/Plugin/resource/ResourceEntity.php

[CLEANUP] Fix a typo in th error message

d5e8f9b by jeff-h (G)

Improve error message by removing a typo.

:100644 100644 cddcda5... 5feb304... M  src/Plugin/resource/Resource.php
:100644 100644 fb2b2f4... 4720628... M  src/Plugin/resource/ResourceEntity.php

[BUGFIX] Turn update result into array for DB queries.

4a2f639 by jeff-h (G)

Data providers' update() method must return an array. The returned value
from this method is ultimately passed via $page_callback_result to
drupal_deliver_page() which expects it the value to be:

 * @param $page_callback_result
 *   The result of a page callback. Can be one of:
 *   - NULL: to indicate no content.
 *   - An integer menu status constant: to indicate an error condition.
 *   - A string of HTML content.
 *   - A renderable array of content.
:100644 100644 1b7c386... 8c7da11... M  src/Plugin/resource/DataProvider/DataProviderDbQuery.php

[BUGFIX] Return 422 when a consumer request invalid operations

4c5f88e by jeff-h (G)

Things like filtering by disabled fields, sorting by a computed
property, etc.
commit f661c14
Author: jeff-h [email protected]
Date: Fri Dec 11 12:13:32 2015 +1300

Update DataProvider.php

Throw 422 not 503 when invalid urlParams are present.
:100644 100644 c47114a... 62d300e... M  src/Plugin/resource/DataProvider/DataProvider.php
:100644 100644 5cc2b06... 5bc40d7... M  tests/RestfulListTestCase.test

[CLEANUP] Fixed c&p description in Users resource

a24c2b5 by Theodoros Ploumis (G)

It was showing the articles resource instead.

:100644 100644 2282779... bb5bdf2... M  src/Plugin/resource/Users__1_0.php

[CLEANUP] Fix docs in the hook_help

a71ad60 by Theodoros Ploumis (G)

To point them to the correct version and display in the correct
place.

:100644 100644 9623915... e101652... M  restful.module

[BUGFIX] Re-index array after taking out unauthorized entities

5b02042 by Mateu Aguiló Bosch (G)

Not doing this could cause false negatives in isArrayNumeric.

:100644 100644 889259d... 12e5a71... M  modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
:100644 100644 b0fc62e... a5e8aad... M  src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php
:100644 100644 c097361... 6d3dcf1... M  src/Plugin/resource/DataProvider/DataProviderEntity.php
:100644 100644 d210480... 7be2f7e... M  src/Plugin/resource/DataProvider/DataProviderPlug.php

[CLEANUP] Depencencies: README.md improvement

e4fc3ad by jeff-h (G)

Make optional Entity Validator module version dependency more explicit.

:100644 100644 c542080... f714a84... M  README.md

[BUGFIX] Add multiverse sources to fix Travis CI builds

054e315 by Mateu Aguiló Bosch (G)

Travis CI stopped working all of the sudden. Apace fastcgi support
package was failing to install.

:100644 100644 ce0a01f... 99409b9... M  .travis.yml

[BUGFIX] Remove Content-Length header

15274ed by Mateu Aguiló Bosch (G)

Under some data conditions reporting an invalid content lenght can
result in invalid JSON for some Content-Type. Remove the
Content-Length header.

:100644 100644 98de87c... a9e4a9e... M  src/Formatter/FormatterManager.php
:100644 100644 7c2534e... 65a7df1... M  src/Http/Response.php

[CLEANUP] Use helper function to init query

8a8ca98 by jeff-h (G)

Instead of initializing the query directly, use the helper function
to get it.

:100644 100644 01cbcec... 1b7c386... M  src/Plugin/resource/DataProvider/DataProviderDbQuery.php

7.x-2.3

03 Dec 16:56
Compare
Choose a tag to compare

[BUGFIX] Avoid INNER JOIN for LEFT JOIN filters

fa5205c by Mateu Aguiló Bosch (G)

If the first field condition (alphabetically) is a LEFT JOIN filter,
make sure that subsequent fields do not join to it with an INNER
JOIN.

:100644 100644 9f2f944... c47114a... M  src/Plugin/resource/DataProvider/DataProvider.php
:100644 100644 adb10cb... 85a8340... M  src/Util/EntityFieldQuery.php

[BUGFIX] Better support for forbidden entities

7c956e5 by Mateu Aguiló Bosch (G)

When requesting a forbidden entity a 403 should arise. When
requesting a forbidden entity as part of a list, it should be
ignored and reported as denied in the metadata.

:100644 100644 f03350f... 889259d... M  modules/restful_example/src/Plugin/resource/variables/DataProviderVariable.php
:100644 100644 7ef87d4... f552044... M  modules/restful_token_auth/src/Plugin/resource/AccessToken__1_0.php
:100644 100644 64964e5... 66fe45a... M  restful.admin.inc
:100644 100644 b898f45... 2edf0ad... M  restful.info
:000000 100644 0000000... 52fc653... A  src/Exception/InaccessibleRecordException.php
:100644 100644 a8df667... fb599b5... M  src/Plugin/formatter/FormatterJson.php
:100644 100644 5c21672... c5007c9... M  src/Plugin/formatter/FormatterJsonApi.php
:100644 100644 e78c224... b0fc62e... M  src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php
:100644 100644 f898625... c097361... M  src/Plugin/resource/DataProvider/DataProviderEntity.php
:100644 100644 e32a452... 4b6e05a... M  src/Plugin/resource/DataProvider/DataProviderFile.php
:100644 100644 4993a24... d210480... M  src/Plugin/resource/DataProvider/DataProviderPlug.php
:100644 100644 946c0ca... 0c3839c... M  src/Plugin/resource/Decorators/CacheDecoratedResource.php
:100644 100644 d51d845... 1478305... M  src/Plugin/resource/Field/ResourceFieldEntity.php
:100644 100644 955688e... cddcda5... M  src/Plugin/resource/Resource.php
:100644 100644 3dc5cb8... c85af4e... M  tests/RestfulDiscoveryTestCase.test
:100644 100644 076b4c6... f74de58... M  tests/RestfulEntityUserAccessTestCase.test
:100644 100644 519d3dd... 265c7e8... M  tests/RestfulExceptionHandleTestCase.test
:000000 100644 0000000... f13009d... A  tests/RestfulForbiddenItemsTestCase.test
:100644 100644 7df77aa... 811781a... M  tests/RestfulJsonApiTestCase.test
:100644 100644 0d5e9a8... 5cc2b06... M  tests/RestfulListTestCase.test
:100644 100644 26fd73e... e3197c9... M  tests/modules/restful_test/restful_test.module

[BUGFIX] Handle invalid entity error

e37a569 by Mateu Aguiló Bosch (G)

If the underlying data provider does not return a resource field
collection, we cannot call any related method to it.

:100644 100644 ec3fd10... e78c224... M  src/Plugin/resource/DataProvider/CacheDecoratedDataProvider.php

[BUGFIX] Allow disabling default resources from the admin

194ef8d by Mateu Aguiló Bosch (G)

Connect the admin interface so plugins are disbled.

:100644 100644 a27059f... 9623915... M  restful.module
:100644 100644 f949bdd... 3dc5cb8... M  tests/RestfulDiscoveryTestCase.test

[BUGFIX] Remove trailing slash to fix resource list

fc8cb65 by Roy Segall (G)

Remove the trailing slash in the dynamic hook_menu that leads to
the 404 on the discovery page.

:100644 100644 17f124e... a27059f... M  restful.module
:100644 100644 3e087b0... f949bdd... M  tests/RestfulDiscoveryTestCase.test

[FEATURE] Allow setting the bundles to FALSE

b49b024 by edwardaa (G)

If the bundles are set to FALSE then the no bundles are considered
in the generated EFQ instead of adding them all.

:000000 100644 0000000... 2edd60c... A  modules/restful_example/src/Plugin/resource/comment/Comments__1_0.php
:000000 100644 0000000... 7ca6e00... A  modules/restful_example/src/Plugin/resource/comment/DataProviderComment.php
:100644 100644 de9a129... b898f45... M  restful.info
:100644 100644 9a75c7e... f898625... M  src/Plugin/resource/DataProvider/DataProviderEntity.php
:000000 100644 0000000... c1e24c7... A  tests/RestfulCommentTestCase.test

[BUGFIX] Pass in the interpreter to the ResourceField::value

5000a51 by Mateu Aguiló Bosch (G)

Failing to do so results in a PHP error with the type hinting.

:100644 100644 6319283... d53d726... M  src/Plugin/resource/Field/ResourceField.php

7.x-1.6

02 Dec 02:55
Compare
Choose a tag to compare

[SECURITY] Avoid remote execution

a12e801 by Mateu Aguiló Bosch (G)

Avoid an unexpected function to be run by using a non existent HTTP
verb.

:100644 100644 54100b1... 997bbb4... M  restful.module
:100644 100644 7d5a468... 10dc506... M  tests/RestfulHookMenuTestCase.test

7.x-2.2

18 Nov 18:21
Compare
Choose a tag to compare

[BUGFIX] Remove cache fragments during shutdown

b2d1b33 by Mateu Aguiló Bosch (G)

When an entity is updated or deleted we need to clear caches and
remove the cache fragments. The problem is that depending on the
site configuration, that operation may be affected for a rolling
back transaction. Defer the clearing to the shutdown instead.

:100644 100644 fcd7c91... e5a64dd... M  restful.entity.inc
:100644 100644 085bd66... 685ea47... M  src/RenderCache/RenderCache.php
:100644 100644 127fdd3... 5d8d385... M  tests/RestfulRenderCacheTestCase.test

[CLEANUP] Friendly error for incompatible BETWEEN ops

52f2ce4 by Mateu Aguiló Bosch (G)

When the BETWEEN operator is used, then 2 values should be provided
otherwise when piping the options along to the data provider there
will be an incomprehensible error. For MySql that means a syntax
error.

:100644 100644 59eadc0... 9f2f944... M  src/Plugin/resource/DataProvider/DataProvider.php
:100644 100644 b0825b2... 9a75c7e... M  src/Plugin/resource/DataProvider/DataProviderEntity.php

[FEATURE] Add helper method to get count query

0e2878c by edwardaa (G)

Improve the DX by adding a helper method to get the count query.

:100644 100644 f1fb6c8... b0825b2... M  src/Plugin/resource/DataProvider/DataProviderEntity.php
:100644 100644 dcd5deb... d30b54b... M  src/Plugin/resource/DataProvider/DataProviderNode.php

7.x-2.1

15 Nov 15:53
Compare
Choose a tag to compare

[BUGFIX] Remove the deprecated dependency ui-select2

fcaa5d5 by Kevin Porras (G)

Instead use the maintained project of ui-select for the angular
frontend example.

:100644 100644 782b973... a5c3ca6... M  docs/api_url.md

[CLEANUP] Modify comments on inherited properties to use inheritdoc

360bbdf by hw (G)

Make the docblocks in the custom exceptions to inherit from the
parent exception type.

:100644 100644 d91bd59... 081dd94... M  src/Exception/BadRequestException.php
:100644 100644 070e180... 63b4afb... M  src/Exception/FloodException.php
:100644 100644 63fbe30... 5baaee5... M  src/Exception/ForbiddenException.php
:100644 100644 6413bcb... 340f9fc... M  src/Exception/GoneException.php
:100644 100644 71a59a0... 3a9f005... M  src/Exception/IncompatibleFieldDefinitionException.php
:100644 100644 712a32c... ac7e670... M  src/Exception/InternalServerErrorException.php
:100644 100644 b5da87f... b3c2d8f... M  src/Exception/NotFoundException.php
:100644 100644 f0bd99e... 5ccafaf... M  src/Exception/NotImplementedException.php
:100644 100644 47c0345... ed54b73... M  src/Exception/ServerConfigurationException.php
:100644 100644 d0392c0... e0b450f... M  src/Exception/ServiceUnavailableException.php
:100644 100644 f6a5f82... 1040ba6... M  src/Exception/UnauthorizedException.php
:100644 100644 1a50d72... dd63971... M  src/Exception/UnprocessableEntityException.php
:100644 100644 57a9330... 9dfc584... M  src/Exception/UnsupportedMediaTypeException.php

[BUGFIX] Check for correct deletion access

915f0df by Mateu Aguiló Bosch (G)

Fix a copy and paste error that allowed users to delete their own
content when they had access to update it.

:100644 100644 2ab5ef9... f1fb6c8... M  src/Plugin/resource/DataProvider/DataProviderEntity.php

[CLEANUP] Use the hash getter

88ced07 by Mateu Aguiló Bosch (G)

Use the cache ID helper function instead of assuming that the cache
ID is going to always be the hash.

:100644 100644 b8a8e97... 085bd66... M  src/RenderCache/RenderCache.php

[FEATURE] Avoid having JSON API without fields

dcc8179 by Mateu Aguiló Bosch (G)

If all provided fields are invalid, return an empty JSON API
structure.

:100644 100644 5048492a.. 5c21672... M  src/Plugin/formatter/FormatterJsonApi.php

[BUGFIX] Check for the presence of fragments before saving

d6eda5a by Mateu Aguiló Bosch (G)

If we delegate it to the uniqueness of sql then we may be aborting
ongoing code that relies on transactions. Like the Cache Consitent
module.

:100644 100644 9dc18e1... 0ad5f82... M  src/Plugin/formatter/Formatter.php

7.x-2.0

13 Nov 14:07
Compare
Choose a tag to compare

[CLEANUP] Port Auth token tests to 2.x

26dbca9 by Mateu Aguiló Bosch (G)

Add the auth token tests to the test suite.

:100644 100644 4a29dc6... 0555442... M  modules/restful_token_auth/restful_token_auth.info
:100644 100644 cf50097... c749323... M  modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php
:000000 100644 0000000... 03fe34a... A  modules/restful_token_auth/src/Plugin/resource/Articles__1_3.php
:100644 100644 ee4ed2f... 9ab0990... M  modules/restful_token_auth/tests/RestfulTokenAuthenticationTestCase.test

7.x-2.0-beta3

08 Nov 00:56
Compare
Choose a tag to compare
7.x-2.0-beta3 Pre-release
Pre-release

[FEATURE] Record last-access time for users

1c1927e by Mateu Aguiló Bosch
When a user's account is loaded, the user table should be updated
to indicate that they have made an authenticated request. This
mirrors the logic in _drupal_session_write().

[BUGFIX] Allow updates with NULL values

4b11b84 by Mateu Aguiló Bosch
Make sure that you can set NULL value via PUT and PATCH.

Also, check for property access after setting the value. The result
of the access check may depend on the new value being set during
write operations.

[BUGFIX] Refresh token cleanup

9bac16f by Mateu Aguiló Bosch
Delete the access token associated with a refresh token when a new
refresh token is created. Also clean up the reference table.

[BUGFIX] Only count the published nodes

637b1fb by Mateu Aguiló Bosch
Add the NODE_PUBLISHED condition to the count query to match the
list query. Otherwise pagination is off.

[BUGFIX] Fix typo: texfield -> textfield

f7857b7 by Mateu Aguiló Bosch

[CLEANUP] Improve wording in admin pages

a7a92f3 by Mateu Aguiló Bosch
Help users have a better understanding of the options.

[FEATURE] Allow more operators per filters

26d767b by Mateu Aguiló Bosch
Adds more flexibility to query the exact elements needed.

[FEATURE] Add watchdog entry if exception was thrown

c4b22b9 by Mateu Aguiló Bosch
Log as warning or error depending on the HTTP error code.

[BUGFIX] Generate access token and refresh token for correct users

b01ccc5 by Mateu Aguiló Bosch
This is a port #489 to 7.x-2.x.

[BUGFIX] Improve performance for discovery

8f71512 by Mateu Aguiló Bosch
Only calculate the allowed value defaults if there are no allowed
values provided by the definition.

[BUGFIX] Allow relationships on entity properties

8d08069 by Mateu Aguiló Bosch
If the property is not known, then fallback to inspecting the
field definition for the resource key.

7.x-2.0-beta2

02 Nov 17:23
Compare
Choose a tag to compare
7.x-2.0-beta2 Pre-release
Pre-release

[BUGFIX] Fix the resource plugin reference

d178aa2 by Mateu Aguiló Bosch
So the cache placeholder population can load the plugin.

[BUGFIX] Re-add links to individual items in listings

10d6deb by Mateu Aguiló Bosch
Add self link to every individual item in a listing.

7.x-2.0-beta1

02 Nov 01:00
Compare
Choose a tag to compare
7.x-2.0-beta1 Pre-release
Pre-release

FIRST BETA!

7.x-1.4

24 Oct 12:01
Compare
Choose a tag to compare

[CLEANUP] Fix watchdog resource's class name

c31a950 by jeff-h
Correct a typo in the class name with a misplaced capital F.

[FEATURE] Update user's access time when authenticating

797dc60 by Luke Wertz
When a user makes an authenticated request, update the access time
on the user object. Just like core does.

[BUGFIX] Allow falsey values to have process callbacks

11e213b by Sam Ingle
Process callbacks are aborted if there resulting value of the
field, or previous process callbacks, is falsey. This commit fixes
that.

[CLEANUP] Documentation improvements for discovery

fcec08f by jeff-h
Include documentation clarifications about the discovery subsystem
and some fixes for typos.

[BUGFIX] Fix URL generation for the Angular example

2be98f1 by jeff-h
Fix the incorrect URL generation for the angular example module.
This includes cases where there is a language code in the URL
and links to statically served files.

[BUGFIX] Allow Patch/ Put NULL values

14a145e by Or

[CLEANUP] Remove old access token when using refresh token

db89d74 by Luke Wertz
If the refresh token is used, go ahead and remove the access token
instead of waiting for it to be expired (if it's not already) and
the cron to delete it.

[BUGFIX] Match default NODE_PUBLISHED filter for count query

dc53c14 by Pedro Cambra
Add the filter for NODE_PUBLISHED to the count query by default,
just like we are doing it for the regular query. Failing to do this
leads to pagination errors.

[BUGFIX] Fix typo: texfield => textfield

a61051f by jeff-h
In the discovery of field information sometimes we were returning the
type of "texfield" instead of "textfield".