I have read different SE posts and Drupal.org posts about applying patches using git but I am getting an error message whenever I try any of the following methods. the error is:

error: modules/callbacks.inc: No such file or directory

I tried:

curl https://www.drupal.org/files/issues/op_update_should_be_create-2807275-2.patch | git apply -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   668  100   668    0     0   2278      0 --:--:-- --:--:-- --:--:--  2279
error: modules/callbacks.inc: No such file or directory

Also, I downloaded the patch into Drupal root and tried:

git apply -v op_update_should_be_create-2807275-2.patch

The backstory: I was getting the following errors on my website, which I found this discussion explaining that it was because of Entity API, and I was trying to apply the patch in #2.

Notice: Undefined property: stdClass::$custom in block_block_list_alter() (line 794 of /Applications/AMPPS/www/example/docroot/modules/block/block.module). Notice: Undefined property: stdClass::$visibility in block_block_list_alter() (line 807 of /Applications/AMPPS/www/example/docroot/modules/block/block.module). Notice: Undefined property: stdClass::$pages in block_block_list_alter() (line 817 of /Applications/AMPPS/www/example/docroot/modules/block/block.module).

This is my first time trying to apply a patch.

1 Answer 1


Place op_update_should_be_create-2807275-2.patch into the module folder, in this case being the sites/all/modules/entity folder.

Then in your terminal cd (change directory) into the module folder.

cd /var/www/drupal/sites/all/modules/entity


git apply -v op_update_should_be_create-2807275-2.patch

In the discussion, Fago has commited this patch (2 months ago), but into the 7.x-.1.x only.

enter image description here

So I assume you're trying to patch the stable version, 7.x-1.8.

If you use/download the latest dev (7.x-1.x-dev) version, it will already have the patch.

Note: The rule of thumb, is to use the Stable version rather than the Dev version.

enter image description here

  • Thanks for the comments. I check and I am already on 1.8 version. So I guess that means that this patch isn't the answer I need.
    – Christia
    Apr 24, 2017 at 0:42
  • 1
    @Christia you misunderstood. The 1.8 version does not have the patch yet (as the commit was made 2 months ago to the 1.x, the 1.8 was released 5 months ago, which means it does not have the patch, so you need to apply the patch to the 1.8.
    – No Sssweat
    Apr 24, 2017 at 0:44
  • I counted the months wrong, 1.8 was released 7 months ago, but yeah you get my point :)
    – No Sssweat
    Apr 24, 2017 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.