]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2728 creating a name for plugins with 1.7 manifests based on hellekin's patch
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 15 Dec 2010 21:46:30 +0000 (21:46 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 15 Dec 2010 21:46:30 +0000 (21:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7638 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPluginManifestParser17.php

index 8e4a79e4fdcb71ae56e72c8b7667ab0702945eda..eb7ccadc10fe10c47bb26fb4e7cee8b7df262fc1 100644 (file)
@@ -15,7 +15,10 @@ class ElggPluginManifestParser17 extends ElggPluginManifestParser {
                'copyright', 'license', 'elgg_version',
 
                // were never really used and not enforced in code.
-               'requires', 'recommends', 'conflicts'
+               'requires', 'recommends', 'conflicts',
+
+               // not a 1.7 field, but we need it
+               'name',
        );
 
        /**
@@ -28,6 +31,8 @@ class ElggPluginManifestParser17 extends ElggPluginManifestParser {
                        return false;
                }
 
+               $elements = array();
+
                foreach ($this->manifestObject->children as $element) {
                        $key = $element->attributes['key'];
                        $value = $element->attributes['value'];
@@ -45,6 +50,10 @@ class ElggPluginManifestParser17 extends ElggPluginManifestParser {
                        }
                }
 
+               if ($elements && !array_key_exists('name', $elements)) {
+                       $elements['name'] = $this->caller->getName();
+               }
+               
                $this->manifest = $elements;
 
                if (!$this->manifest) {