Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
7.0.0
-
Target OS Affected
- Blackberry10
- Seemingly every other platform that has not been updated to the PlatformAPI (in this scenario every platform marked deprecated)
Cordova Version
- 7.1.0
Host Operating System
- Ubuntu Xenial docker container running on Windows 10
- Ubuntu 14.04 LTS
NodeJS Version
- v6.10.2 LTS
- v8.9.4 LTS
Target OS Affected Blackberry10 Seemingly every other platform that has not been updated to the PlatformAPI (in this scenario every platform marked deprecated) Cordova Version 7.1.0 Host Operating System Ubuntu Xenial docker container running on Windows 10 Ubuntu 14.04 LTS NodeJS Version v6.10.2 LTS v8.9.4 LTS
-
Patch
Description
There is a circular dependency within the util.js file (src/cordova/util.js) and the platforms.js file (src/platforms/platforms.js).
This circular dependency causes the platforms variable to equal an empty JavaScript object ({}); as a result when within the getPlatformApiFunction the else condition !platforms[platform] on line 498 is always trigerred causing deprecated platforms to always fail upon attempted addition to the project.
This bug also seems to affect the hostSupports function on line 94.
Can someone more versed in this components inner workings confirm if this is indeed a bug? I would be happy to attempt a fix if it is but would need to discuss my idea for a potential fix with a more experienced dev first to ensure I don't break hidden dependencies.
Potential fix:
On line 30 change var platforms = require('../platforms/platforms'); to var platforms = require('../platforms/platformsConfig.json');