General plugins

Error: "Invalid add-on name"

 
 
Just wondering . . .
Error: "Invalid add-on name"
Group Particularly helpful Moodlers

I've tried installing two add-ons today (Attendance and Course menu) by downloading a zip file from GIT and uploading from inside Moodle.

Both times I get an error "Invalid add-on name" (see image)

The explanation of the error is this: "The name of the root directory in the ZIP package violates formal syntax requirements. Some ZIP packages, such as those generated by Github, may contain an incorrect root directory name. You need to fix the name of the root directory to match the add-on name"

What is the best thing to do?

I'm trying to avoid hacking zip files.

-Derek

 


 
Average of ratings: -
Picture of John Andrewartha
Re: Error: "Invalid add-on name"
 

That should be easy, just rename the extracted folder/directory to the correct name.

I.E.  mv this_total_funny_module to [propermodulename] the name if not obvious should be in the version.php file.

 
Average of ratings: -
Picture of Ken Task
Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

23_dev???!!!  Development?

Please see: http://docs.moodle.org/23/en/Attendance_module

which says:

The installation can only be performed by a user who has both write access to the file structure on the computer hosting Moodle and administrator rights for the Moodle installation.

The module

  • Log into the computer that hosts your Moodle installation.
  • Download the Attendance module zip file appropriate for your Moodle version, as linked to from the table in section "Branches" above, and unzip it.
  • This should result in a directory with a name like andreev-artem-moodle_mod_attforblock-175cd46. Rename it to attforblock.
  • Move the downloaded, unzipped, and renamed directory attforblock to your Moodle installation directory/mod, resulting in directory your Moodle installation directory/mod/attforblock.
    • On a Linux system, assuming you've installed Moodle in the standard location, that directory should be /var/www/html/moodle/mod/attforblock.
    • Note: if you are upgrading from an earlier version of the module, first delete the old version by opening the Moodle page in your browser, logging in as an administrator, going to Settings > Site administration > Plugins > Activity Modules > Manage Activities, then pressing the delete link next to the name "attforblock".
  • Change the ownership and read/write/execute privileges of the directory's files to match the rest of your Moodle installation's files.
    • On a Linux system, you can do this in the following way:
      • Check the owner and group of the other files by commanding ls -l /var/www/html/moodle.
      • Command sudo chown -Ruser:group/var/www/html/moodle/mod/attforblock, where user and group are the same as for the other files of the Moodle installation.

The block (optional)

  • Download the Attendance block zip file appropriate for your Moodle version, as given in the table in section "Branches" above, and unzip it.
  • This should result in a directory with a name like andreev-artem-moodle_mod_attforblock-175cd46. Rename it to attendance.
  • Move the downloaded, unzipped, and renamed directory attendance to your Moodle installation directory/blocks, resulting in directory your Moodle installation directory/blocks/attendance. (If you already have such a directory when starting the installation, delete it first, or rather, rename it to keep it around for safety.)
  • As with the module, change the ownership and read/write/execute privileges of the directory's files to match the rest of your Moodle installation's files.

BTW, if it's zipped in-correctly you have two choices ... either wait until it is 'packaged' as other mods/blocks or use directions above.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Alex Contis
Re: Error: "Invalid add-on name"
Group Translators

Hi,

Unfortunately as long as you download CM from Github you have to "hack" the zip files otherwise it will not perform the install.

Regards
Alex Contis
NetSapiensis AB

 
Average of ratings: -
Just wondering . . .
[RESOLVED, sort of] Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

@Ken Darn, forgot to read the instructions.  smile  Done the hacking . . .
@Alex, OK, we've hacked . . .

Out of four critical plugins for our server, three require hacking to install.  The new plugins system is still not quite working for us.  I get it for installing on older versions of Moodle.  But it seems we are all having trouble keeping up with the bleeding edge.

Onwards.

-Derek

 

 
Average of ratings: -
Picture of Ken Task
Re: [RESOLVED, sort of] Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

Maybe the 'trick' (if one can figure it out) is to stay one step behind 'bleeding edge'! ;)  While it does make life interesting as a Moodle Server admin, it can be 'last straw' for those teachers/students using when the tool is in constant flux (ie, in need of fixing).

Through the years, I've learned to be patient ... never use .0 of anything.   Yes, do install a 'sandbox' for testing and wait for the 'omicron testers' to find/sort out those new bugs.   Generally, if one waits til .2 releases, some of the majors have been fixed - that's not scientific, I know, but as a general rule it's worked well for me.  Even though it's sometimes difficult to convince folks to be patient and wait ... especially in an 'instant gratification' digital world. :|

'spirit of sharing', Ken

 

 
Average of ratings: -
Picture of Emma Richardson
Re: [RESOLVED, sort of] Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

The reason for this is that you are installing plugins from their github repositories or installing plugins that are not in the Moodle plugin directory.  Github owners tend to name their plugin folders with more detail as they are often working on a few copies at once.  It is really not a hack to simply rename a folder and is normally specified in the install instructions.  The beauty of Moodle is that anyone can contribute but the downside is that sometimes addins act a little differently.

 
Average of ratings: -
Picture of Tuğçe Aldemir
Re: Error: "Invalid add-on name"
 

I am sorry ı am a bit new to module settings. What do you mean by hacking?

Could you please help me as I have the same problem?

Thank you very much

 
Average of ratings: -
Davo
Re: Error: "Invalid add-on name"
Group DevelopersGroup Particularly helpful Moodlers

Without the details of the add-on that you were trying to install or the error message being displayed, it is hard to give generic advice.

Please give a bit more detail about the problem and someone should be able to help you.

 
Average of ratings: -
Picture of Tuğçe Aldemir
Re: Error: "Invalid add-on name"
 

Hello,thanks for your reply. I am trying to install formulas question type. The older versions did not work so i download a version with the name of moodle-qtype_formulas-master from Github. Yet, the system keeps giving the same error message while trying  to install the add-on. The message is :

My LMS module version is Moodle 2.6.1+ (Build: 20140117).

I am sorry I am so new to module environment. Could you please explain how I can use this add-on if it is possible? Thank you very much.

 

 
Average of ratings: -
Davo
Re: Error: "Invalid add-on name"
Group DevelopersGroup Particularly helpful Moodlers

OK, so this looks like you're installing this plugin: 

https://github.com/jmvedrine/moodle-qtype_formulas

The plugin should be installed to:

[moodle code directory]/question/type/formulas

(i.e. you should be able to see [moodle code directory]/question/type/formulas/version.php when you look in that directory)

Unfortunately, the zip files automatically generated by github call the internal directory something like 'moodle-qtype_formulas-master', so after unzipping the files, you need to rename the directory from 'moodle-qtype_formulas-master' to 'formulas', before uploading it to your server and placing it in [moodle code directory]/question/type/

Plugins downloaded directly from moodle.org automatically have their directories named correctly, but that particular plugin doesn't appear to be available here (maybe you could contact the developer and ask them to upload it to moodle.org?)

 
Average of ratings:Useful (1)
Picture of Tuğçe Aldemir
Re: Error: "Invalid add-on name"
 

Thank you very much. It works .

 
Average of ratings: -
Picture of Emma Richardson
Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

Just read my post at the bottom of the page - it explains how to rename it.

 
Average of ratings: -
Picture of Tuğçe Aldemir
Re: Error: "Invalid add-on name"
 

Thank you very much for your answer. How can I rename the folder? What is the structure that module accepts?

I am really sorry it can be an easy question but I am pretty new to this enviroment, and trying to learn it.

 

 
Average of ratings: -
Picture of Emma Richardson
Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

Unzip the folder.  Take the '-master' part off the end of the name of the folder.  Rezip the folder.  Then you should be good. (If you are on a Mac, you might need to remove the ds store file before rezipping (this is a hidden file that macs add to every folder) as it will occasionally force an error).

 
Average of ratings:Useful (1)
Picture of Tuğçe Aldemir
Re: Error: "Invalid add-on name"
 

Thank you very much. It works

 
Average of ratings: -
Picture of Emma Richardson
Re: Error: "Invalid add-on name"
Group Particularly helpful Moodlers

John is correct.  You need to rename it.  I have found on some you can just rename the zip file but on others you need to unzip the folder, rename it just the name of what you are installing e.g. Attendance and then rezip it.  Then you can install as usual through the install interface.

 
Average of ratings: -