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

Widget ID & ACF data missing #25

Closed
mike-sheppard opened this issue Jul 8, 2020 · 3 comments
Closed

Widget ID & ACF data missing #25

mike-sheppard opened this issue Jul 8, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mike-sheppard
Copy link
Sponsor Contributor

mike-sheppard commented Jul 8, 2020

Hey @Log1x, thanks again for the awesome package. I've just moved onto generating a few widgets but can't seem to access any ACF field data, it looks like the widget id is blank.

Steps to reproduce

  1. $ wp acorn acf:widget Example
  2. Add the widget, title & list items

Output: Missing title & No items found!


Possible solution

I've had a quick look and it seems adding

$this->widget->id = 'widget_' . Arr::get($args, 'widget_id');

within the widget() render method fixes it, but not entirely sure that's the right place to set it?

Also perhaps changing $this->widget->id to $this->id in widget.stub:L43 & widget.stub:L73 ?

Cheers!

@Log1x Log1x self-assigned this Jul 9, 2020
@Log1x
Copy link
Owner

Log1x commented Jul 9, 2020

Will look into this ASAP - its more than likely related to $this->widget being defined inside of the filter.

As far as $this->id I kept it more so for compatibility - I switched back to $this->widget->id in the stubs at one point as I felt it was less confusing along with wanting to make people aware of $this->widget without having to reference it in docs.

Log1x added a commit that referenced this issue Jul 13, 2020
fix(widgets): Fix widget registration (Fixes #25)
@Log1x Log1x added the bug Something isn't working label Jul 14, 2020
@Log1x
Copy link
Owner

Log1x commented Jul 14, 2020

https://github.com/Log1x/acf-composer/tree/log1x/bugfixes I've started on this here but I'm getting trolled a bit due to hook ordering – I'll fix it today/tomorrow as it's about to get in my way on my current project.

Log1x added a commit that referenced this issue Jul 15, 2020
enhance(contracts): Add contracts for unique composer types
@mike-sheppard
Copy link
Sponsor Contributor Author

nice one, thanks! not sure if I can be of any help, but give me a shout if there is anything, testing etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants