backdrop-contrib / honeypot

Backdrop port of Drupal module. Uses both the honeypot and timestamp methods of deterring spam bots from completing forms on your site.
GNU General Public License v2.0
3 stars 1 forks source link

.tests.info file throwing off core module installer/updater "Cannot determine the type of project" #6

Closed sutibun closed 7 years ago

sutibun commented 8 years ago

When tried to install the Honeypot module on Backdrop, received the following error

Cannot determine the type of project.

Luckily, the Nate has already figured out the fix

The packager on BackdropCMS.org requires that you have a line in your .info file to identify what kind of project it is (as themes, modules, and layouts are all mashed together here in the backdrop-contrib group).

It's also required for the Backdrop installer to install a remote module from a .zip file, as of 1.2.0. See backdrop/backdrop-issues#1215.

To fix this, just add:

type = module

To the .info file.

klonos commented 8 years ago

Did you try the 1.0.2 version? That one has type = module in its .info already.

sutibun commented 8 years ago

I think so unless did something wrong

  1. I went to https://backdropcms.org/project/honeypot
  2. Copied link from "Download 1.x-1.0.2"

    https://github.com/backdrop-contrib/honeypot/releases/download/1.x-1.0.2/honeypot.zip

    and pasted into the install page ("admin/modules/install")

  3. Error then appears on top with "Cannot determine the type of project."

    honey

I don't know if it matters but this is on a fresh install of Bd so it's the latest version 1.2.2

I had a similar error with the Markdown project (that Nate fixed) which is why I thought we could use the same solution. Maybe the problem is something else?

herbdool commented 8 years ago

Odd I get the same error. But when I compare the .info with one that works: https://github.com/backdrop-contrib/markdown/blob/1.x-1.x/markdown.info I don't see how it could be failing there. I'm pretty sure the order doesn't matter. I'll keep looking. Can you try an earlier version and see if it works?

herbdool commented 8 years ago

So I was able to install a previous version but not later ones. This compares that version to the latest: https://github.com/backdrop-contrib/honeypot/compare/51c8e2ed077a7e66a43f6aa8b1f5edceb3969595...1.x-1.x I can't see anything that might have broken that feature. I know the module installs if you upload the files via ftp or via a commit, just not the UI install way.

sutibun commented 8 years ago

This is beyond the monkey. Will try to upload module via FTP later. Hopefully, it works out.

klonos commented 8 years ago

This looks like a core issue. All Backdrop should need to be able to determine a project type is that type = line in the project's .info file. @quicksketch?? ...input if you spare the time please.

docwilmot commented 8 years ago

Same solution. The 'tests' directory has an .info file without the 'type' flag.

Having said that though, our type checking process could use a little more intelligence to know test directories or test .info files.

herbdool commented 8 years ago

I've confirmed the same problem with other modules with .info in their tests folder with no type flag. https://github.com/backdrop-contrib/codefilter/releases/download/1.x-1.1.0/codefilter.zip So I too think this is a core issue @quicksketch

klonos commented 8 years ago

@herbdool: are you suggesting auto-assigning the type = module to .info files contained within /test directories? ...or to put it better assuming that this is the case.

herbdool commented 8 years ago

I don't know what's best. I'd like to know if the install ui should be ignoring the .info files inside tests or if we should be adding the type = module there too. The second option seems unintuitive.

sutibun commented 8 years ago

Minor update: uploading via FTP works like black magic

quicksketch commented 8 years ago

Instead of ignoring the tests directory, I think we should determine the project type from the first found .info file, doing breadth-first search. That is, a .info file in the root will be considered the "primary" project type. Then any .info files nested 1 level deep will be found next. Then any 2 levels deep. As almost all projects contain .info files directly in the root, this will work for nearly all modules.

quicksketch commented 8 years ago

We'll solve this problem in core in the issue @klonos opened at https://github.com/backdrop/backdrop-issues/issues/1294.

sutibun commented 8 years ago

FYI:

Jen says

The solution is to add a type = module to the very top of all info files (including ones in tests). It's true that this shouldn't be necessary after backdrop/backdrop-issues#1294 is completed, but that would enable people to use the project now.

jenlampton commented 7 years ago

the module type line has been added, closing.

herbdool commented 7 years ago

@jenlampton it's not about the honeypot.info file but honeypot.tests.info which is causing the error. This needs to be solved in core so the GUI installer only checks the .info at the first level and ignores all others.

jenlampton commented 7 years ago

I just re-read the whole issue, sorry about closing prematurely. This is a strange problem for sure, but will likely affect a ton of projects, as lots have tests included. I'll go have a look at that core issue...

jenlampton commented 7 years ago

I'm unable to reproduce this problem on backdrop 1.7.0 or above. Can someone who was having the problem initially confirm that it's still an issue?

herbdool commented 7 years ago

I'm also unable to reproduce it with the latest version of honeypot and Backdrop 1.7.0 +. I tried both the installer GUI and pasting the zip file into the manual installer GUI. Both were successful.

Closing issue.