It is not possible to save cdn none selection. Actually it is correctly saved, but when you visit form again in selection you will again see jsDelivr in selection. This is happening because in bootstrap_bootstrap_cdn_provider_jsdelivr_assets_alter() $provider value will be overriden by foreach on line 367.

Comments

pivica’s picture

Here is a patch.

markhalliwell’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Assigned: Unassigned » neardark

I'm not entirely sure if the 8.x CDN provider are working properly. @neardark, please verify the parity of these branches.

@pivica:

FWIW.. if the issue is, in fact, the foreach loop then that is the area the patch should affect: the variable that the foreach loop uses should be changed, not the existing one that preceded it.

pivica’s picture

StatusFileSize
new1.2 KB

I'm not entirely sure if the 8.x CDN provider are working properly.

I am not using CDN providers so didn't check that part.

Yeah the foreach is a problem because it is overriding previous var. Here is a new patch that is renaming var in foreach. Also found one additional bug, on page settings form load this

$form_values = $form_state->getValues('cdn_provider');

is returning empty array so next isset needs to be changed to !empty.

  • neardark committed 32f39b7 on 8.x-3.x authored by pivica
    Issue #2535990 by pivica, neardark: CDN provider settings form not saved
    
neardark’s picture

Status: Active » Needs review

I've merged @pivica 's patch but could use someone to test. Also made a few other changes. Committed this before providing a patch -- sorry about that.

Status: Needs review » Needs work

The last submitted patch, 3: cdn-provider-settings-not-saved-2535990-3.patch, failed testing.

neardark’s picture

Status: Needs work » Needs review
pol’s picture

Hi all,

The module Libraries API CDN is out today: https://www.drupal.org/project/libraries_cdn

It will probably help you to have a good integration in your theme.

Let me know if I can help.

markhalliwell’s picture

@Pol, that looks like a cool module indeed. However, this project will likely never depend on an external module to provide integration/support in this manner. If we ever do add a module, it will be for internal purposes that only a module can hook into, like we have been doing with https://www.drupal.org/project/bootstrap_core

markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Component: Theme settings » Code
Assigned: neardark » Unassigned
Status: Needs review » Closed (fixed)

This isn't needed on 7.x-3.x.