PIPs that are not present should not be treated as unresolved
authorAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2018 12:12:08 +0000 (13:12 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2018 12:12:08 +0000 (13:12 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Devtools/Project/Sync.js

index 41c6ae1edb14af69be104f58b34bec821b1bd460..71fbb77898db91416eb3fe8096fc365e2ca5a818 100644 (file)
@@ -18,7 +18,7 @@ define(['Ajax', 'Dictionary', 'Language', 'Ui/Dialog'], function (Ajax, Dictiona
                                _container.classList.toggle('jsShowOnlyMatches');
                        });
                        
-                       var knownPips = [], tmpPips = [];
+                       var existingPips = [], knownPips = [], tmpPips = [];
                        elBySelAll('.jsHasPipTargets:not(.jsSkipTargetDetection)', _container, (function (pip) {
                                var pluginName = elData(pip, 'plugin-name');
                                var targets = [];
@@ -52,6 +52,8 @@ define(['Ajax', 'Dictionary', 'Language', 'Ui/Dialog'], function (Ajax, Dictiona
                                        _pips.push(data);
                                        knownPips.push(pluginName);
                                }
+                               
+                               existingPips.push(pluginName);
                        }).bind(this));
                        
                        var resolvedDependency = false;
@@ -63,6 +65,12 @@ define(['Ajax', 'Dictionary', 'Language', 'Ui/Dialog'], function (Ajax, Dictiona
                                        item = tmpPips[i];
                                        
                                        openDependencies = item.dependencies.filter(function (dependency) {
+                                               // Ignore any dependencies that are not present.
+                                               if (existingPips.indexOf(dependency) === -1) {
+                                                       window.console.info('The dependency "' + dependency + '" does not exist and has been ignored.');
+                                                       return false;
+                                               }
+                                               
                                                return (knownPips.indexOf(dependency) === -1);
                                        });
                                        
@@ -188,4 +196,4 @@ define(['Ajax', 'Dictionary', 'Language', 'Ui/Dialog'], function (Ajax, Dictiona
                        }
                }
        };
-});
\ No newline at end of file
+});