ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
926 stars 220 forks source link

Box and Addable box options conflict with WordPress 5.5 #4029

Open warudin opened 4 years ago

warudin commented 4 years ago

I just updated a site to WordPress 5.5 and I noticed that the box option isn't functioning well any more. The collapse functionality won't work and looks malformed. The same goes for the addable box.

I've read that the jQuery version would be updated in WordPress 5.5. Could this have something to do with that?

Schermafbeelding 2020-08-12 om 10 49 39

This is a huge problem for when boxes are closed by default, as they can't be opened any more.

warudin commented 4 years ago

@ViorelEremia I think this is a critical error and hope you are able to take time to solve this.

dsgadmin commented 4 years ago

I'm seeing the same problem after update to 5.5 Capture

mbissett commented 4 years ago

There may be a workaround for you both in the meantime, but I'd need to know:

  1. How this can be reproduced.
  2. What specifically you're using (e.g. the "Page Builder" extension, the "Brizy" extension).
  3. Whether you're using the latest version of the item in question.

Disclaimer: I'm not the developer, I'm just a guy here to help.

dsgadmin commented 4 years ago

@mbissett thank you for the tip!

warudin commented 4 years ago

Hi @mbissett

  1. In my case this can be reproduced by adding a box in the theme settings:

    $options = array(
    'company_partners' => array(
         'type' => 'box',
         'title' => __('Partners', 'f80'),
         'attr' => array('class' => 'initialized'),
         'options' => array(
         'partners' => array(
               'type'  => 'addable-box',
               'value' => array(),
               'label' => false,
               'box-options' => array(
               'partner_name' => array(
                     'type'  => 'text',
                     'value' => '',
                     'label' => __('Bedrijfsnaam', 'f80'),
                     'desc' => __('Voor intern gebruik', 'f80'),
               ), // partner_name
                  'partner_link' => array(
                     'type'  => 'text',
                     'value' => '',
                     'label' => __('Link', 'f80'),
                     'desc'  => __('Inclusief \'http://\' of \'https://\'', 'f80'),
                  ), // partner_link
                  'partner_image' => array(
                     'type'  => 'upload',
                     'value' => array(),
                     'label' => __('Beeld', 'f80'),
                     'images_only' => true,
                  ), // partner_image
               ),
               'template' => 'Partner: {{- partner_name }}', // box title
               'limit' => 0, // limit the number of boxes that can be added
               'add-button-text' => __('Toevoegen', 'f80'),
               'sortable' => true,
         ), // partner_box
         ), // options
    ), // company_partners
    )
  2. I'm just using Unyson, we're using the Classic Editor but as said this problem is happening on the Theme Options-page.

  3. Unyson 2.7.23 and WordPress 5.5

warudin commented 4 years ago

@dsgadmin what's the tip that you're thanking @mbissett for? 😯

dsgadmin commented 4 years ago

lol, I was thinking he said to use the page builder instead of Unyson. my bad I read too quickly

etwordpress01 commented 4 years ago

Hi Guys

How we can solve this issue? in console there are some JS issues with latest release of WordPress 5.5

5 6

How we can solve issue with tabs, Addable boxes etc

Thanks in advance

abhishekfdd commented 4 years ago

Same issue I am facing here seems like the dropdown toggle button has few more elements added to it's parent Maybe it's because of changes in WP Dashicons with 5.5.

Screenshot 2020-08-12 at 11 04 49 PM
mbissett commented 4 years ago

Hey guys, I'll need some more time to advise on an answer here, I'll follow up here ASAP. Some of what you have may not be available here on GitHub, so that may affect things, but I'll do my best to help out.

NasimNet commented 4 years ago

Hey guys, This is a temporary way to open and close the box !

File : backend.php

Find

$meta_box_template = str_replace(
    'class="postbox',
    $placeholders['attr'] . ' class="postbox fw-postbox' . $placeholders['attr_class'],
    $meta_box_template
);

Replace

$meta_box_template = str_replace(
    'class="postbox ',
    $placeholders['attr'] . ' class="postbox fw-postbox' . $placeholders['attr_class'],
    $meta_box_template
);

File : backend-options.js

Find

function addPostboxToggles($boxes) {
    /** Remove events added by /wp-admin/js/postbox.js */
    $boxes.find('h2, h3, .handlediv').off('click.postboxes');

    var eventNamespace = '.fw-backend-postboxes';

    // make postboxes to close/open on click
    $boxes
        .off('click'+ eventNamespace) // remove already attached, just to be sure, prevent multiple execution
        .on('click'+ eventNamespace, '> .hndle, > .handlediv', function(e){
            var $box = $(this).closest('.fw-postbox');

            if ($box.parent().is('.fw-backend-postboxes') && !$box.siblings().length) {
                // Do not close if only one box https://github.com/ThemeFuse/Unyson/issues/1094
                $box.removeClass('closed');
            } else {
                $box.toggleClass('closed');
            }

            var isClosed = $box.hasClass('closed');

            $box.trigger('fw:box:'+ (isClosed ? 'close' : 'open'));
            $box.trigger('fw:box:toggle-closed', {isClosed: isClosed});
        });
}

Replace

function addPostboxToggles($boxes) {
    /** Remove events added by /wp-admin/js/postbox.js */
    $boxes.find('h2, h3, .handlediv').off('click.postboxes');

    var eventNamespace = '.fw-backend-postboxes';

    // make postboxes to close/open on click
    $boxes
        .off('click'+ eventNamespace) // remove already attached, just to be sure, prevent multiple execution
        .on('click'+ eventNamespace, ' .hndle,  .handlediv', function(e){
            var $box = $(this).closest('.fw-postbox');

            if ($box.parent().is('.fw-backend-postboxes') && !$box.siblings().length) {
                // Do not close if only one box https://github.com/ThemeFuse/Unyson/issues/1094
                $box.removeClass('closed');
            } else {
                $box.toggleClass('closed');
            }

            var isClosed = $box.hasClass('closed');

            $box.trigger('fw:box:'+ (isClosed ? 'close' : 'open'));
            $box.trigger('fw:box:toggle-closed', {isClosed: isClosed});
        });
}

Do not forget Ctrl + F5 / hard refresh

Note: This is not a complete solution!

warudin commented 4 years ago

Yes, that seems to do the trick! At least, the boxes are opening and closing again. I still see the weird icons next to the caret, but that's fine for now. Thanks so far, @mbissett and @NasimNet 🙌

NasimNet commented 4 years ago

Ok, I fixed it and I am testing it and I will share it in a few minutes @warudin ;)

Niloys7 commented 4 years ago

@ThemeFuse must need to release an urgent update for WordPress 5.5

NasimNet commented 4 years ago

You can use this fork until the plugin designer updates it

1- Back up your project first. 2- Update unyson with this fork https://github.com/NasimNet/Unyson

Note: I checked, I didn't see any error at the moment

Niloys7 commented 4 years ago

Hi @NasimNet , what about this one https://prnt.sc/tyxwte ?

warudin commented 4 years ago

Hi @NasimNet , what about this one https://prnt.sc/tyxwte ?

That one is happening when using rgba-color-picker, right?

Niloys7 commented 4 years ago

@warudin yes.

On Thu, Aug 13, 2020, 7:02 PM Dominique Pijnenburg notifications@github.com wrote:

Hi @NasimNet https://github.com/NasimNet , what about this one https://prnt.sc/tyxwte ?

That one is happening when using rgba-color-picker, right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ThemeFuse/Unyson/issues/4029#issuecomment-673464550, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQSNN4ISH5Z7WLFRRIU6HTSAPP6DANCNFSM4P4LFEMA .

mbissett commented 4 years ago

@etwordpress01 @Niloys7 I just opened a PR to @NasimNet's fork with a change that fixes this field.

By the way, thanks for following up on the boxes issue @NasimNet, had quite a bit on my plate yesterday. :)

mbissett commented 4 years ago

@dsgadmin Is your problem resolved as well? Or are you still running into issues?

etwordpress01 commented 4 years ago

Hi @mbissett Issue is still there, can you please let us know how to fix it?

Thanks

mbissett commented 4 years ago

@etwordpress01 To be clear, you're referring to the "Uncaught ReferenceError: wpColorPickerL10n is not defined" error? If so, then until the PR is merged, you can replace the version that's installed with this one: https://github.com/mbissett/Unyson/archive/master.zip

If not, please clarify & I'll do my best to advise further.

etwordpress01 commented 4 years ago

Hello, @mbissett really appreciate your struggle

It fixed the issue, but i have thousands of customers, so they are requesting for update.

unyson

Is there ETA for update? so we can let us customers know about that fix

Thanks in advance

mbissett commented 4 years ago

@etwordpress01 I'm glad that the fix works, but to be clear, I'm not the guy that made this theme framework (or an employee of ThemeFuse), I'm just a guy that's been trying to help folks with WordPress 5.5 update issues where I can.

My advice would be to contact their support team: https://support.themefuse.com/hc/en-us/requests/new - and ask them what the status is of fixing this long-term.

etwordpress01 commented 4 years ago

Hello @mbissett Thank you for the help, really appreciate your efforts. I think they have stop supporting this plugin and we now needs to switch from that plugin to another one. Currently we will use your fix for our themes.

Thanks

Bilyachenko commented 4 years ago

how to deal with this error? wait for updates?

warudin commented 4 years ago

You can download and install the package made by @mbissett and @NasimNet on all your sites which use Unyson. But it would be best if ThemeFuse would release an update with those fixes.

I hope @ViorelEremia, @andreiglingeanu, @GheorgheP will pick this up, it was promised that critical errors with Unyson would be solved. Even better, the solution is now coming from the community and that means they only have to add it to the repository.

NasimNet commented 4 years ago

Hi @NasimNet , what about this one https://prnt.sc/tyxwte ?

I did not review this section, only the problem that was in issues has been reviewed and fixed by me I will give a new path soon

NasimNet commented 4 years ago

Hi @NasimNet , what about this one https://prnt.sc/tyxwte ?

That one is happening when using rgba-color-picker, right?

@warudin @dsgadmin @mbissett @etwordpress01 @abhishekfdd @Niloys7 @Bilyachenko

Fixed rgba color picker Update again https://github.com/NasimNet/Unyson

etwordpress01 commented 4 years ago

Hello @NasimNet, It has fixed by @mbissett

6

I also tried your repo and it is same, well done

7

Thank you so much all of you

NasimNet commented 4 years ago

Hello @NasimNet, It has fixed by @mbissett

6

Thank you so much all of you

What I checked was that only the error was fixed, otherwise the color box would not have been displayed properly ! ;) But now ...

rgba-color-piker

Good luck

mbissett commented 4 years ago

Well done @NasimNet, thanks for following up on this one as well! :)

NasimNet commented 4 years ago

Well done @NasimNet, thanks for following up on this one as well! :)

You're welcome. :)

francyneps commented 4 years ago

Hello friends, hope you all are fine!

I installed the Unyson Master, but my problem remains. I'm trying to edit the pages, but the unyson model won't open. There is no way to edit with the template, only shows the code of the page as you can see in the picture.

unyson

goran468 commented 4 years ago

Hello, guys.

Has anyone contacted the @ThemeFuse team regarding this issue? It is almost a week passed and the bug is quite critical :(

NasimNet commented 4 years ago

Hello @goran468 I do not think it will be updated soon, Use this fork https://github.com/NasimNet/Unyson/archive/master.zip

warudin commented 4 years ago

Hello, guys.

Has anyone contacted the @ThemeFuse team regarding this issue? It is almost a week passed and the bug is quite critical :(

I have sent a tweet, Slack message, a ticket on their site and created this ticket in which I’ve tagged multiple Unyson developers. So far I’ve not heard anything from them, unfortunately.

mbissett commented 4 years ago

I submitted a ticket over on https://support.themefuse.com/ but was reminded that they moved their support over to https://support.brizy.io/hc/en-us. I just submitted a post over there now, hopefully they'll see it there.

goran468 commented 4 years ago

@mbissett Thank you. We are using this fork and it helped much, but sometimes the issue still remains on client's sites even with the patch (we cannot find out the reason why)

The problem is that many customers are using Unyson and seems to be theme updates are required.

We really appreciate your help with a fork! I hope the ThemeFuse will answer soon.

yura-x commented 4 years ago

Hi, @NasimNet Thanks for your fixes! I saw that you have created a pull request: https://github.com/ThemeFuse/Unyson/pull/4035

But you did not linked it tot this issue.

Can you change it please and add a link to this thread according to the Contributors requirements? https://github.com/ThemeFuse/Unyson/blob/master/CONTRIBUTING.md Thanks again

NasimNet commented 4 years ago

Hi, @yura-x Thank you for your reminder, I added

mbissett commented 4 years ago

Just as a heads up, Unyson's not going to be updated in the near future: https://support.brizy.io/hc/en-us/community/posts/360072483732-What-is-the-status-on-Unyson-being-updated-for-WP-5-5-

For anyone needing a fix, if @NasimNet's fork (https://github.com/NasimNet/Unyson/archive/master.zip) isn't merged in the meantime, you'll need to use that instead of the official release.

goran468 commented 4 years ago

It's very sad. I hope they will come back soon, because Unyson is unusable at this moment without patch or fork and almost everyone already updated to the WordPress 5.5 :(

goran468 commented 4 years ago

I have found a situation in which fork by @NasimNet does not work. In case addable boxes are used with boxes, like in this example. Boxes and addable boxes won't work:

$options = array(
    'settings' => array(
        'title'   => esc_html__( 'Additional Settings', 'unyson' ),
        'type'    => 'box',
        'options' => array(
            'items' => array(
                'label' => esc_html__( 'Items', 'unyson' ),
                'type' => 'addable-box',
                'value' => array(),
                'box-options' => array(             
                    'name' => array(
                        'label' => esc_html__( 'Name', 'unyson' ),
                        'type' => 'text',
                        'value' => '',
                    ),
                ),
                'template' => '{{- name }}',
            ),
            'items-2' => array(
                'label' => esc_html__( 'Items 2', 'unyson' ),
                'type' => 'addable-box',
                'value' => array(),
                'box-options' => array(             
                    'name' => array(
                        'label' => esc_html__( 'Name', 'unyson' ),
                        'type' => 'text',
                        'value' => '',
                    ),
                ),
                'template' => '{{- name }}',
            ),
        ),
    ),  
);
NasimNet commented 4 years ago

Just as a heads up, Unyson's not going to be updated in the near future

@mbissett , I'm really sorry, many of our projects have been synchronized with this framework! :( I will try to update it next year, to find a suitable replacement

@goran468, Can you send a picture of the problem?

Niloys7 commented 4 years ago

Just as a heads up, Unyson's not going to be updated in the near future: https://support.brizy.io/hc/en-us/community/posts/360072483732-What-is-the-status-on-Unyson-being-updated-for-WP-5-5-

For anyone needing a fix, if @NasimNet's fork (https://github.com/NasimNet/Unyson/archive/master.zip) isn't merged in the meantime, you'll need to use that instead of the official release.

it's just broken my heart. I really love this framework. all of our themes & plugins are based on Unyson. maybe it's time to switch this wonderful framework. maybe the team is fully focused on brizy . I wish the team change their mind. if they only release an update for major WordPress updates that's also fine.

warudin commented 4 years ago

Maybe it's a good idea to chime in on the discussion @mbissett created. To me it seems to be the only place where ThemeFuse actually responded, so far.

I've added a comment as well (still needs to be approved), offering to pay for the work that needs to be done for a bugfix update, in case money is the prime problem. Maybe we could even start up a crowdfunding action, just to give us (developers) some more time to migrate to another framework or new sites alltogether. We never received a definitive notice that Unyson wouldn't be supported anymore, the last I heard from @ViorelEremia was that critical problems would still be solved.

So please add a comment on https://support.brizy.io/hc/en-us/community/posts/360072483732-What-is-the-status-on-Unyson-being-updated-for-WP-5-5-.

To me this seems to be the only

goran468 commented 4 years ago

@NasimNet here is an screenshot:

image

Maybe I'm missing something, but the problem is when using addable-boxes with meta-box containers http://manual.unyson.io/en/latest/options/introduction.html#containers

I have not found a restriction regarding it in documentation and on WordPress 5.4.x this code works correctly. Seems to be the issues caused by several .inside containers and the click events performed twice. So the addaable-box inside box doing toggleClass('closed'; twice.

NasimNet commented 4 years ago

@goran468 I did not check in box mode I am testing this and because I am busy now, my review may take a few days

Question: Boxes do not open? Or is it just a style bug?

warudin commented 4 years ago

Alex from Brizy said the following:

"Hi guys,

I understand your dissatisfaction and I sent all these requests to the team and we will make an update that will fix the critical issues. I can't give you a timeframe but we'll look at that."

So there's perspective, let's hope the update will be there soon!