Skip to content

Commit

Permalink
Merge branch '5.0'
Browse files Browse the repository at this point in the history
* 5.0: (29 commits)
  [MediaBundle] Create runtime config hash using the original image path (#1500)
  [FormBundle] Update regex translation (#1933)
  Change label required for choice pagepart (#1934)
  Change required value for new window menu item (#1932)
  [Documentation] remove addition to upgrade guide that was merged in incorrectly (#1911)
  Update add new translation (#1914)
  [Composer][GeneratorBundle] fix testing + limit fos user to 2.0.* (#1922)
  update changelog
  added option to fix the automated tests on the standard edition (#1912)
  recompile assets
  update changelog
  [MultiDomainBundle]: host override should be set before getting default locale (#1889)
  [KunstmaanAdminBundle]: access level for google should add groups (#1868)
  [AdminListBundle] Start and end form using tab pane, if it exists (#1890)
  [NodeBundle]: node data collector should go to node id (#1891)
  [FormBundle]: add batchsize to export list (#1887)
  [AdminBundle] use bootstrap's default z-index values & remove unnecessary transition and transform props on app__content (#1885)
  [Docs]: move to readthedocs documentation (#1880)
  [GeneratorBundle] Change logic of page title (#1874)
  [LeadGenerationBundle]: times should not be blank (#1865)
  ...
  • Loading branch information
Devolicious committed Apr 27, 2018
2 parents b300f99 + dc4c362 commit 569cc3f
Show file tree
Hide file tree
Showing 49 changed files with 357 additions and 234 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG-5.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## 5.0.6 / 2018-04-13

* [GeneratorBundle] Fix article generator for no-interaction [#1912](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1912) ([@Devolicious](https://github.com/Devolicious))
* [NodeBundle]: node data collector should go to node id [#1891](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1891) ([@sandergo90](https://github.com/sandergo90))
* [AdminListBundle] Start and end form using tab pane form view, if it exists [#1890](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1890) ([@mtnorthrop](https://github.com/mtnorthrop))
* [MultiDomainBundle]: host override should be set before getting default locale [#1889](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1889) ([@sandergo90](https://github.com/sandergo90))
* [FormBundle]: add batchsize to export list [#1887](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1887) ([@sandergo90](https://github.com/sandergo90))
* [AdminBundle] Fix Bootstrap modals on smaller screens [#1885](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1885) ([@dbeerten](https://github.com/dbeerten))
* [Docs - 5.0]: move to readthedocs documentation [#1880](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1880) ([@sandergo90](https://github.com/sandergo90))
* [GeneratorBundle] Change logic of page title [#1874](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1874) ([@treeleaf](https://github.com/treeleaf))
* [GeneratorBundle] Fixed limit in generated article repository [#1871](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1871) ([@jordanmoon](https://github.com/jordanmoon))
* [KunstmaanAdminBundle]: fix permissions [#1869](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1869) ([@sandergo90](https://github.com/sandergo90))
* [KunstmaanAdminBundle]: access level for google should add groups [#1868](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1868) ([@sandergo90](https://github.com/sandergo90))
* [LeadGenerationBundle]: times should not be blank [#1865](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1865) ([@sandergo90](https://github.com/sandergo90))
* [GeneratorBundle] Fixed bundle namespace in article generator pagepart config [#1864](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1864) ([@jordanmoon](https://github.com/jordanmoon))
* [AdminBundle]: redirect to previous page when logging in with Google [#1862](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1862) ([@sandergo90](https://github.com/sandergo90))
* [GeneratorBundle]: fixes for article generator [#1860](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1860) ([@sandergo90](https://github.com/sandergo90))
* [AdminBundle] Make it possible to search in all PagePartChoosers [#1854](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1854) ([@NindroidX](https://github.com/NindroidX))
* [SeoBundle]: fields are not required [#1851](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1851) ([@sandergo90](https://github.com/sandergo90))
* [NodeBundle] Check for mapping exception when multiple entity manager… [#1819](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1819) ([@delboy1978uk](https://github.com/delboy1978uk))


## 5.0.5 / 2018-03-05

* [AdminBundle] Fix escaping of img src attributes in WYSIWYG fields [#1858](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1858) ([@mtnorthrop](https://github.com/mtnorthrop))


## 5.0.4 / 2018-02-20

* [AdminListBundle]: ->loadTemplate() is only for internal use.. [#1846](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/1846) ([@sandergo90](https://github.com/sandergo90))
Expand Down
14 changes: 2 additions & 12 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,7 @@ liip_imagine:
- "%kernel.root_dir%/../link/to/your/symlinked/path/web"
- "%kernel.root_dir%/../web"
```
## Deprecated Form Types
All existing form types have been deprecated in order to satisfy Sensio Insight requirements that form type classes go in a `Form/Type` folder instead of justr `Form`. Existing projects will not break, the old classes are still there, but the logic has been moved into the new classes in the correct folder, and the old classes now extend the new one, and have a `@deprecated` tag.
#### Refactoring your form types
It is very simple, just add `Type` into your use statement.
```php
use Kunstmaan\NodeBundle\Form\ControllerActionAdminType;
```
becomes
```php
use Kunstmaan\NodeBundle\Form\Type\ControllerActionAdminType;
```

## Forms must be referenced via FQCN [brakes BC]

All forms were upgraded to be used by **fully qualified class name** instead of creating new form instance.
Expand Down Expand Up @@ -156,7 +146,7 @@ The nodetranslationlistener has been cleaned for a better flush event. The postF
## FormBundle

The Discriminator map has been removed from the abstract entity `Kunstmaan\FormBundle\Entity\FormSubmissionField`. This makes it a whole lot easier to
extend the FormSubmission with your own FormSubmission fields. So what happens. If you are using the standard formsubmission, basically nothing. Everything just keeps working.
extend the FormSubmission with your own FormSubmission fields. So what happens. If you are using the standard formsubmission, basically nothing. Everything just keeps working.

Now if you have customized the standard formsubmission you probably will have to do some changes. Most vital part is that the `discriminator` value will change from for instance "string" to "stringformsubmissionfield".
As you can see it now uses the entity class name to dynamically map the inheritance. This is where stuff will start to break during querying the database and no result will be found. So for this you will have to manually generate the following migration.
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",

"friendsofsymfony/user-bundle": "~2.0",
"friendsofsymfony/user-bundle": "2.0.*",
"knplabs/knp-menu-bundle": "~2.0",
"guzzlehttp/guzzle": "~6.1",
"white-october/pagerfanta-bundle": "~1.0",
Expand Down Expand Up @@ -95,12 +95,11 @@
"kunstmaan/tagging-bundle": "self.version"
},
"conflict": {
"friendsofsymfony/user-bundle": "<2.0.0"
"friendsofsymfony/user-bundle": "<2.0.0, >=2.1.0"
},
"autoload": {
"psr-4": {
"Kunstmaan\\": "src/Kunstmaan/",
"Tests\\Kunstmaan\\": "tests/"
"Kunstmaan\\": "src/Kunstmaan/"
}
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions docs/cookbook/enabling-google-auth-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ user upon first login.
¦ client_id: some_client_id.apps.googleusercontent
¦ client_secret: some_secret
¦ hosted_domains:
¦ ¦ - { domain_name: kunstmaan.be, access_levels: ['ROLE_SUPER_ADMIN'] }
- { domain_name: mydomain.example, access_levels: ['ROLE_USER'] }
¦ ¦ - { domain_name: kunstmaan.be, access_levels: ['Super administrators'] }
- { domain_name: mydomain.example, access_levels: ['Guests'] }
```

## 2) Configure the guard component in your app/config/security.yml
Expand Down
2 changes: 0 additions & 2 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Documentation specific to the KunstmaanBundlesCMS can be found on:
* [Going single language](../cookbook/going-single-language.md)
* [Managing translations](../cookbook/manage-translations.md)
* [Google Analytics dashboard](../cookbook/google-analytics-dashboard.md)

> Writing documentation is hard. Especially if the writer is fully into the topic at hand. This results in the glossing over of obvious information for the writer, that might not be obvious for everyone else. We wholeheartedly appreciate pull requests or suggestions for this documentation.
## Contribute
Expand All @@ -41,7 +40,6 @@ We follow most of the procedures for contributions from the [Symfony](http://sym
* [Submitting pull requests](../contributing/pull-requests.md)
* [Coding standards](../contributing/coding-standards.md)
* [Preparing a new release](../contributing/preparing-a-new-release.md)

## Support

For questions you can always ask your question via a Github Issue ([following the same guidelines as bug reporting](../contributing/reporting-issues.md)) or shoot us an email at bundles AT kunstmaan.be.
Expand Down
15 changes: 13 additions & 2 deletions src/Kunstmaan/AdminBundle/Form/MediaTokenTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,21 @@ function (Crawler $node) {
if (isset($query['token'])) {
$image->setAttribute('src', $query['token']);
}
$image->setAttribute('data-src', urldecode($src));
$image->setAttribute('data-src', $src);
}
);

return $crawler->filter('body')->html();
$html = $crawler->filter('body')->html();

// URL-decode square brackets in img and a tags
$html = preg_replace_callback(
'/<(img|a)\s+[^>]*>/',
function($matches) {
return str_replace(['%5B', '%5D'], ['[', ']'], $matches[0]);
},
$html
);

return $html;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function bindRequest(Request $request)
$user = $this->tokenStorage->getToken()->getUser();
$this->createAclChangeSet($this->resource, $changes, $user);

$cmd = 'php bin/console kuma:acl:apply';
$cmd = 'php ' . $this->kernel->getRootDir() . '/../bin/console kuma:acl:apply';
$cmd .= ' --env=' . $this->kernel->getEnvironment();

$this->shellHelper->runInBackground($cmd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace Kunstmaan\AdminBundle\Helper\Security\OAuth;

use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Model\GroupInterface;
use Kunstmaan\AdminBundle\Entity\User;

class OAuthUserCreator implements OAuthUserCreatorInterface
{
/** @var EntityManager */
/** @var EntityManagerInterface */
private $em;

/** @var array */
Expand All @@ -21,9 +22,10 @@ class OAuthUserCreator implements OAuthUserCreatorInterface

/**
* OAuthUserCreator constructor.
*
* @param EntityManagerInterface $em
* @param $hostedDomains
* @param $userClass
* @param array $hostedDomains
* @param string $userClass
* @param OAuthUserFinderInterface $userFinder
*/
public function __construct(EntityManagerInterface $em, $hostedDomains, $userClass, OAuthUserFinderInterface $userFinder)
Expand Down Expand Up @@ -56,7 +58,11 @@ public function getOrCreateUser($email, $googleId)
}

foreach ($this->getAccessLevels($email) as $accessLevel) {
$user->addRole($accessLevel);
/** @var GroupInterface $group */
$group = $this->em->getRepository('KunstmaanAdminBundle:Group')->findOneBy(['name' => $accessLevel]);
if (null !== $group) {
$user->addGroup($group);
}
}
$user->setGoogleId($googleId);

Expand Down
8 changes: 4 additions & 4 deletions src/Kunstmaan/AdminBundle/Resources/public/css/style.css

Large diffs are not rendered by default.

0 comments on commit 569cc3f

Please sign in to comment.