backdrop-contrib / node_clone

Allows users to make a copy of an existing node and then edit that copy easily. Has also been used by some to facilitate node templating.
GNU General Public License v2.0
1 stars 5 forks source link

Cannot install using the install UI #8

Closed herbdool closed 4 years ago

herbdool commented 5 years ago

When trying to install using the install UI at /admin/modules/install I get this error:

There was an error getting information for node_clone

I wonder if it's because clone.info doesn't match the folder name "node_clone". We should probably change that.


PR https://github.com/backdrop-contrib/node_clone/pull/10 by @klonos

herbdool commented 5 years ago

@klonos you brought up this issue before, perhaps we should change it to node_clone.info and change all the files and functions to match. I'm not 100% sure that's the problem but seems likely.

pnmgman2 commented 5 years ago

Also reporting this issue when trying to install using the install UI at /admin/modules/install; I get this error: There was an error getting information for node_clone

mazzech commented 4 years ago

I managed to install it after un- and re-enabling the module

klonos commented 4 years ago

Yeah, I think that you must be right @herbdool.

We have inherited this mess from the D7 module, and although I don't particularly like it, it seems that renaming files/functions may be the way to go 🤔

klonos commented 4 years ago

...I wonder if we could get away with this:

I believe that you cannot have "orphan" .info files, so we will also need an empty node_clone.module file.

@mazzech can you please try the above on your local, and let me know if the errors you've been having go away?

klonos commented 4 years ago

...you see https://www.drupal.org/docs/7/creating-custom-modules/writing-module-info-files-drupal-7x mentions this:

The .info file should have the same name as the .module file and reside in the same directory. For example, if your module is named example.module then your .info file should be named example.info.

So it does not mention that the folder name should match the .info and the .module filename ...only that the .info and .module files should live under the same folder 🤷‍♂

mazzech commented 4 years ago

@klonos added your code, enabled another module, the error message did not appear again, cloning nodes still works > worx:-)

klonos commented 4 years ago

Thanks for testing my theory @mazzech 👍

@herbdool I don't think that renaming functions is the way to go here, as we may be breaking other contrib. See https://www.drupal.org/project/node_clone

Important: In general, any complex or custom node type may not clone cleanly. This module has an extra hook in case you want to try to do a little extra cleanup to make a specific node type work. For example, if you use Field Collections, you may need to also download and enable the extra Field Collection Node Clone module. This can also be used as an example of implementing that hook.

klonos commented 4 years ago

FTR, this is the error @mazzech mentions:

image

...it is shown each time a new module is installed/enabled via the Project Browser, if node_clone is already installed.

I have filed a PR, that adds a node_clone.info file (no need for node_clone.module file during my testing): https://github.com/backdrop-contrib/node_clone/pull/10

herbdool commented 4 years ago

@klonos clever solution.

herbdool commented 4 years ago

I've merged and released this as part of the Bug Fix Team. But unfortunately it doesn't fix the bug. I get the same error message when I attempt to install this module. Sadly this is hard to test without making releases. I'm going to look into the code, but it may be that we could also try add an empty node_clone.module file.

mazzech commented 4 years ago

Hi @herbdool thank you, I will test:-)

herbdool commented 4 years ago

I've added another change by adding an empty node_clone.module. The consensus on Zulip is to do a more radical break by changing all the file and function names. But we'll need to see if we can do an upgrade path at all. I figured we can first try this before trying anything else which might or might not work.

herbdool commented 4 years ago

For some reason the 1.1.4 release isn't appearing when I try to install it via the UI. Maybe just need to wait for server to update or something is wrong.

herbdool commented 4 years ago

Seems ok. I tested a UI install on a different site and it worked okay. I think the basic bug is solved. If we want to rename all the files and functions we should create a new issue. And someone should volunteer to be maintainer of this.