Coder Social home page Coder Social logo

Comments (8)

bennothommo avatar bennothommo commented on June 12, 2024 4

@LukeTowers @arvislacis don't you guys mean #11? 😛

from wn-builder-plugin.

LukeTowers avatar LukeTowers commented on June 12, 2024 2

@ericp-mrel give #11 a test please

from wn-builder-plugin.

ericp-mrel avatar ericp-mrel commented on June 12, 2024 1

@arvislacis If you look at the PluginBase.php class, you can see the base pluginDetails() method will parse the data from the plugin.yaml file if it exists and returns the data under the plugin: key as an array. See https://github.com/wintercms/winter/blob/develop/modules/system/classes/PluginBase.php#L57-L73

Otherwise, if you don't have/use the plugin.yaml file you would override the pluginDetails() method in your Plugin's Plugin.php file and define the array there.

And yes, the replaces key does work in the YAML file, I now have two plugins defining the replaces in the plugin.yaml file and is working just fine. After all, the yaml file just gets parsed into a PHP array anyways.

Hope this makes sense!

from wn-builder-plugin.

arvislacis avatar arvislacis commented on June 12, 2024

I think this is because Builder plugin allows you to only edit name, description, author, icon and homepage fields when you open plugin configuration pop-up (click on gear icon). And only these fields are then saved back to YAML configuration file after save.

I personally don't see this as a big issue because you probably added replaces section externally.

One possible solution may be to add replaces repeater or datatable field into configuration pop-up and logics so it gets properly loaded and saved.

from wn-builder-plugin.

ericp-mrel avatar ericp-mrel commented on June 12, 2024

I don't think this issue is that big of a deal and it's not very often that I need to edit the plugin details via that menu. But it'd be nice if this plugin would account for the new replaces key and would keep it in the output when re-writing the file. Even better would be to add a field to allow adding replacements via this plugin, but that would be just a nice to have.

It seems like it's a pretty easy fix to have it maintain the replaces dictionary upon writing the plugin.yaml file. I can send a PR if that's the route the maintainers would like to go rather than adding UI functionality (at least for now).

from wn-builder-plugin.

arvislacis avatar arvislacis commented on June 12, 2024

@ericp-mrel May I also ask where did you find out that you can use replaces in plugin.yaml configuration? As far as I quickly searched then you can use it under pluginDetails() function - https://wintercms.com/docs/plugin/registration#plugin-replace - but I am not sure about plugin.yaml. Does it even work when used from YAML file?

from wn-builder-plugin.

LukeTowers avatar LukeTowers commented on June 12, 2024

Whoops!

from wn-builder-plugin.

ericp-mrel avatar ericp-mrel commented on June 12, 2024

@LukeTowers It's working for me, even tested it with multiple replaces items

Example of what I've tested.

replaces:
  Acme.Plugin: '<1.0.0'
  Winter.Plugin: <5.5.5

from wn-builder-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.