dependencies[] = drupal:token is not correct, as token in D7 isn't a core module.

Tasks:

  1. Remove dependency declaration
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

navneet0693 created an issue. See original summary.

navneet0693’s picture

navneet0693’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: token_example-2841202-2.patch, failed testing.

navneet0693’s picture

Status: Needs work » Needs review
Torenware’s picture

+++ b/token_example/token_example.info
@@ -3,9 +3,10 @@ description = An example module showing how to define and use tokens.
+dependencies[] = token:token

If you are intending to put a dependency on the Token module in Contrib, DON'T DO THAT. Examples should ONLY depend upon Drupal Core itself. Why do you need Token?

navneet0693’s picture

Title: Correct dependency declaration on token in token_example.info. » Remove dependency declaration on token in token_example.info.
Issue summary: View changes
FileSize
759 bytes

You are right, we can opt out from putting a dependency on token. We actually don't need it. I am removing the dependency completely ! We previously opted to enable it with the module itself to provide token browser.

navneet0693’s picture

Issue summary: View changes
Berdir’s picture

Status: Needs review » Needs work

Yeah, as commented in the other issue, the current definition makes no sense. Drupal core does not have a token module, just an include file, you can not depend on that.

That means you can also remove the bogus system test dependency, which didn't make sense either, it claims that is there to have support for version dependencies, but of course if you wouldn't have that, then it wouldn't work at all and couldn' tell you that you need a newer version.

  • Mile23 committed 85ef59f on 7.x-1.x authored by navneet0693
    Issue #2841202 by navneet0693: Remove dependency declaration on token in...
Mile23’s picture

Status: Needs work » Fixed

If you are intending to put a dependency on the Token module in Contrib...

It's the token example. :-)

IIRC Token was in core, and then it wasn't, and then we decided to leave it in examples, or some similar decision process.

We previously opted to enable it with the module itself to provide token browser.

We should provide the token browser, since our goal is to educate and illustrate.

So we have a couple options: 1) Figure out the right dependency, 2) Remove the example.

Let's go with 1.

We have a couple things, however. I added the namespaced dependency as a branch fix: http://cgit.drupalcode.org/examples/commit/?h=7.x-1.x&id=2a58f549b6850da...

That branch fix passed the branch test, which is very weird, because now we have tests which are failing as a consequence: https://www.drupal.org/pift-ci-job/565769 and https://www.drupal.org/pift-ci-job/566409

We can't run a test here because, as pointed out by @Mixologic, the way project_dependencies and the composer facade work, we can't patch dependencies.

So I will push the change to token/token without review, because Drupal. :-)

Marking this as fixed. We should keep an eye on the branch test, however. I predict it will fail, because the Great Dependency Resolution Machine STILL thinks we want drupal/token. Once it fails, we'll talk to @Mixologic and he'll force that machine to update for examples, and maybe it'll all be better.

Mile23’s picture

As predicted: Phail. https://www.drupal.org/pift-ci-job/566433

So we'll retest after the dependency machine has had a chance to think things through.

Mile23’s picture

And now passed: https://www.drupal.org/pift-ci-job/566434

You may resume working on other issues.

navneet0693’s picture

@Mile23 Awesome!

Mixologic’s picture

Cool. and also dang. Theres some kinda racey condition happening on first commit that changes dependencies. Its like they are one commit behind or something: I opened this to investigate: #2841222: Possible race condition in dependency calculation

navneet0693’s picture

Assigned: navneet0693 » Unassigned

OOps, forgot to unassign.

Status: Fixed » Closed (fixed)

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