Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated & maintained fork #74

Open
tbruckmaier opened this issue Mar 12, 2019 · 11 comments
Open

Updated & maintained fork #74

tbruckmaier opened this issue Mar 12, 2019 · 11 comments

Comments

@tbruckmaier
Copy link

Since development seems not be very active here, I created a fork (actually a complete rewrite): https://github.com/tbruckmaier/corcel-acf

This fork uses eloquent relations to retrieve the acf fields, which massively increases performance. There is also support for option pages, unknown field types, complicated layouts like an image in a repeater in a felxible content, etc.

I use this package in several live websites already, so it will be maintained in the future. Looking forward to feedback!

@tbruckmaier
Copy link
Author

@jgrossi if you do not intend to continue this package anymore, you might consider putting a link to the fork into the readme?

@jgrossi
Copy link
Member

jgrossi commented Mar 12, 2019

@tbruckmaier hey thanks for sharing! instead of forking this I can add you as a member, then you can help me to approve PRs... and you are also welcome to send yours too.. they are very welcome.. and if you did a complete rewrite you're also welcome to share it as well ;-) thank you for the hard work!

@jgrossi
Copy link
Member

jgrossi commented Mar 12, 2019

Corcel (core) was completely rewritten in 2017, and we are moving to a version 3 soon, a completely framework-agnostic package, with Eloquent and Doctrine support as well... you're also welcome to join these next changes... so I guess you have good work to share with the main repository...

you're welcome to send a PR or even help me to make this working.. thanks!

@moazam1
Copy link

moazam1 commented Mar 22, 2019

@jgrossi when do you plan to release new version? Is there any plan for auto generate layout like ACF? Thanks for the hard work!

@tbruckmaier
Copy link
Author

@jgrossi where can i find the corcel rewrite? Is there a special branch? Maybe I'm just blind ;)

Regarding the acf package: as my fork works quite differently than your original package, I don't think we should merge it back into this repository. Or we should increase the version number at least

@jgrossi
Copy link
Member

jgrossi commented Mar 22, 2019

@tbruckmaier Corcel now follows Laravel versions, like 2.8 -> Laravel 5.8. this was done in 2017, and the ACF plugin was developed when Corcel was 1.0. it works with the current version, but it's not designed to match Corcel's versions schema.

can you explain more how your's version works differently from the original one? thanks

@jgrossi
Copy link
Member

jgrossi commented Mar 22, 2019

@moazam1 just released 1.1.1 matching the develop branch. about the auto generate layout, if you give me more information about it, we can work together to make that feature available

@moazam1
Copy link

moazam1 commented Mar 24, 2019

@jgrossi thanks so much. The idea is same as ACF renders and validate forms on CPT and options page, we can do same on Laravel end using Laravel forms. Let's say user place a json file in a acf-json directory and then we can render form using the json file exactly same as ACF. I noticed that tab field is missing here: https://github.com/corcel/acf#fields I know it does nothing but will be cool for presentation purpose.

@tbruckmaier
Copy link
Author

@jgrossi i rewrote the field fetching mechanism with a custom eloquent relation, so it is possible now for instance to preload relations with with() and load(). The relation uses the meta data from the post object, so there are no further queries needed for any acf fields of one post. Any that gives a number of advantages:

  • any encapsulated fields work now, for instance a gallery in a repeater in a flexible field.
  • the option page works exactly like the fields now.
  • the ACF field configuration is also fetched and parsed now and can be taken into account: for instance the link field either returns the url or an array, regarding of what the acf field is configured like.
  • existing & unknown fields can be extended & implemented by the user
  • and last but not least, i implemented unit tests with mocking all the relevant models, so we do not need the sql dump anymore

@codemonkeynorth
Copy link

@tbruckmaier would be great if this could work without Laravel (first issue i hit was with config() function)

I'm actually testing out Corcel within just Wordpress itself, to use the Models for Custom Post Types etc, so I'm not using the Laravel side of it at all

I found your version because this corcel/acf version currently doesn't support Group fields

I'm having to use the older version though because of other dependencies

"jgrossi/corcel": "2.8",
"corcel/acf": "^1.1.1",
"tbruckmaier/corcel-acf": "^1.3"

@tbruckmaier
Copy link
Author

tbruckmaier commented Mar 5, 2020

@codemonkeynorth Hi, I have not planned for such a usage, but it could probably be implemented. I created an issue at tbruckmaier/corcel-acf#7 and commented there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants