<commit_before># Upgrade

## 1.3.0-RC1

### PHPCR

To adapt to the new PHPCR structure execute the migrations:

```
app/console phpcr:migrations:migrate
```

### Media selection overlay
The frontend component 'media-selection-overlay@sulumedia' got removed,
please use 'media-selection/overlay@sulumedia' instead.

### NodeRepository

The `orderBefore` method of the `NodeRepository` has been removed. Use the
`reorder` method of the `DocumentManager` instead.

### LocalizationProvider
The core LocalizationProvider (which provided the system locales)
got removed. At this point the WebspaceLocalizationProvider is the
only LocalizationProvider in Sulu. If the system locales 
(locales in which translations for the admin panel are available) are
needed, please refer directly to the config `sulu_core.translations`.

### Translations
The command `sulu:translate:import` got removed, as the export command
(`sulu:translate:export`) now takes its translations directly from
the translation files and not from the database anymore. This change
would only cause conflicts, if one had a dependency directly on the
translations in the database. If so, please use the files in the
`Resources` folders.

### Publishing

For the publishing a separate workspace was introduced. This workspace
will be created and correctly filled by the PHPCR migrations.

Because the search index is now split into draft and live pages you have
to reindex all the content:

```bash
app/console massive:search:purge --all
app/console massive:search:reindex
app/webconsole massive:search:reindex
```

Also the `persist` call of the `DocumentManager` changed it behavior.
After persisting a document it will not be available on the website
immediately. Instead you also need to call `publish` with the same
document and locale.

### PHPCR Sessions

The sessions for PHPCR were configured at `sulu_core.phpcr` in the
configuration. This happens now at `sulu_document_manager.sessions`. You can
define multiple sessions here using different names and refer to one of them as
default session using the `sulu_document_manager.default_session` and to
another as live session using the `sulu_document_manager.live_session`.

### Documemt Manager Initializer

The `initialize` method of the `InitializerInterface` has now also a `$purge`
parameter, which tells the initializer if it should purge something. The
Initializer can use this information or simply ignore it, but existing
Initializers have to adapt to the new interface.

### Twig variable `request.routeParameters` removed

The `request.routeParameters` variable has been removed because it is not longer required when generate an url.

**Before**

```twig
{{ path('client_website.search', request.routeParameters) }}
```

**After**

```twig
{{ path('client_website.search') }}
```

### TitleBehavior is not localized anymore

If you have implemented your own Documents with an `TitleBehavior`,
you will recognize that the title in PHPCR is not translated anymore.
If you still want this Behavior you have to switch to the
`LocalizedTitleBehavior`.

### Indexing title of pages for search

It was possible to define that the title field of a page should be
indexed as title, although this value was already the default:

```
<property name="title" type="text_line" mandatory="true">
    <meta>
        <title lang="en">Title</title>
    </meta>
    <tag name="sulu.search.field" type="string" role="title" />
</property>
 ```

 This setting does not work anymore, because the title is now handled
 separately from the rest of the structure, and the title is not indexed
 anymore with this tag. Just remove it, and it will be the same as
 before.

### Webspaces

We have deprecated (1.0) the schema for webspaces and created a new version (1.1) of it. 

```
<?xml version="1.0" encoding="utf-8"?>
<webspace xmlns="http://schemas.sulu.io/webspace/webspace"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.sulu.io/webspace/webspace http://schemas.sulu.io/webspace/webspace-1.1.xsd">
          
          ...
          
</webspace>
```

You should update your webspace.xml files soonish. To do that you simply have to move the `default-templates` and
`error-templates` from the `theme` node and put it into the `webspace` node after the `theme`.
 
The theme is now optional and can be used with a theme-bundle. Sulu has extracted this functionality to make it
replaceable with any theming bundle you want. To keep the old directory-structure and functionality please read the
next part of this file.

### Theming

If you have multiple themes (or you don't want to change the folder structure of you project) you have to include the
bundle https://github.com/sulu/SuluThemeBundle in your abstract kernel.

This bundle contains all the code which is necessary to use theming in your application.

### Configuration

The configuration of `sulu_content.preview` and `sulu_website.preview_defaults` has been moved to:

```
$ app/console config:dump-reference sulu_preview
# Default configuration for extension with alias: "sulu_preview"
sulu_preview:
    defaults:
        analytics_key:        UA-SULU-PREVIEW-KEY
    error_template:       ~ # Example: ClientWebsiteBundle:Preview:error.html.twig
    mode:                 auto

    # Used for the delayed send of changes
    delay:                500
```

The flag `sulu_content.preview.websocket` has been replaced with `sulu_websocket.enabled`. This flag is
now default `false`.

### Content-Types

The Interface or content-types has been cleaned. The function `ContentTypeInterface::readForPreview` will never
be called in the future and can therefor be removed.

### Twig variable `request.routeParameters` removed

The `request.routeParameters` variable has been removed because it is not longer required when generate an url.

**Before**

```twig
{{ path('client_website.search', request.routeParameters) }}
```

### Composer autoloader

Run `composer update` to rebuild the autoloader.
## 1.2.7

### Default Country

The default country for addresses in the ContactBundle is set by the ISO 3166 country-code
instead the of database-id now.

## 1.2.4

### ContactRepository

A Interface for the ContactRepository has been created. Due to the refactoring
the function `appendJoins` has been changed from public to protected.
Therefore this function cannot be called anymore.

## 1.2.1

### UserRepository

The methods from the `UserProviderInterface` of Symfony have been moved to a
separate `UserProvider` implementation. Also, the `getUserInSystem` method
has been renamed to `findUserBySystem` and takes the system as an argument.

If you want to use the `Sulu` system you should inject the
`sulu_security.system` container parameter instead of hardcoding it.

## 1.2.0<commit_msg>Removed composer update (was already removed in sulu/sulu) (#732)<commit_after># Upgrade

## 1.3.0-RC1

### PHPCR

To adapt to the new PHPCR structure execute the migrations:

```
app/console phpcr:migrations:migrate
```

### Media selection overlay
The frontend component 'media-selection-overlay@sulumedia' got removed,
please use 'media-selection/overlay@sulumedia' instead.

### NodeRepository

The `orderBefore` method of the `NodeRepository` has been removed. Use the
`reorder` method of the `DocumentManager` instead.

### LocalizationProvider
The core LocalizationProvider (which provided the system locales)
got removed. At this point the WebspaceLocalizationProvider is the
only LocalizationProvider in Sulu. If the system locales 
(locales in which translations for the admin panel are available) are
needed, please refer directly to the config `sulu_core.translations`.

### Translations
The command `sulu:translate:import` got removed, as the export command
(`sulu:translate:export`) now takes its translations directly from
the translation files and not from the database anymore. This change
would only cause conflicts, if one had a dependency directly on the
translations in the database. If so, please use the files in the
`Resources` folders.

### Publishing

For the publishing a separate workspace was introduced. This workspace
will be created and correctly filled by the PHPCR migrations.

Because the search index is now split into draft and live pages you have
to reindex all the content:

```bash
app/console massive:search:purge --all
app/console massive:search:reindex
app/webconsole massive:search:reindex
```

Also the `persist` call of the `DocumentManager` changed it behavior.
After persisting a document it will not be available on the website
immediately. Instead you also need to call `publish` with the same
document and locale.

### PHPCR Sessions

The sessions for PHPCR were configured at `sulu_core.phpcr` in the
configuration. This happens now at `sulu_document_manager.sessions`. You can
define multiple sessions here using different names and refer to one of them as
default session using the `sulu_document_manager.default_session` and to
another as live session using the `sulu_document_manager.live_session`.

### Documemt Manager Initializer

The `initialize` method of the `InitializerInterface` has now also a `$purge`
parameter, which tells the initializer if it should purge something. The
Initializer can use this information or simply ignore it, but existing
Initializers have to adapt to the new interface.

### Twig variable `request.routeParameters` removed

The `request.routeParameters` variable has been removed because it is not longer required when generate an url.

**Before**

```twig
{{ path('client_website.search', request.routeParameters) }}
```

**After**

```twig
{{ path('client_website.search') }}
```

### TitleBehavior is not localized anymore

If you have implemented your own Documents with an `TitleBehavior`,
you will recognize that the title in PHPCR is not translated anymore.
If you still want this Behavior you have to switch to the
`LocalizedTitleBehavior`.

### Indexing title of pages for search

It was possible to define that the title field of a page should be
indexed as title, although this value was already the default:

```
<property name="title" type="text_line" mandatory="true">
    <meta>
        <title lang="en">Title</title>
    </meta>
    <tag name="sulu.search.field" type="string" role="title" />
</property>
 ```

 This setting does not work anymore, because the title is now handled
 separately from the rest of the structure, and the title is not indexed
 anymore with this tag. Just remove it, and it will be the same as
 before.

### Webspaces

We have deprecated (1.0) the schema for webspaces and created a new version (1.1) of it. 

```
<?xml version="1.0" encoding="utf-8"?>
<webspace xmlns="http://schemas.sulu.io/webspace/webspace"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.sulu.io/webspace/webspace http://schemas.sulu.io/webspace/webspace-1.1.xsd">
          
          ...
          
</webspace>
```

You should update your webspace.xml files soonish. To do that you simply have to move the `default-templates` and
`error-templates` from the `theme` node and put it into the `webspace` node after the `theme`.
 
The theme is now optional and can be used with a theme-bundle. Sulu has extracted this functionality to make it
replaceable with any theming bundle you want. To keep the old directory-structure and functionality please read the
next part of this file.

### Theming

If you have multiple themes (or you don't want to change the folder structure of you project) you have to include the
bundle https://github.com/sulu/SuluThemeBundle in your abstract kernel.

This bundle contains all the code which is necessary to use theming in your application.

### Configuration

The configuration of `sulu_content.preview` and `sulu_website.preview_defaults` has been moved to:

```
$ app/console config:dump-reference sulu_preview
# Default configuration for extension with alias: "sulu_preview"
sulu_preview:
    defaults:
        analytics_key:        UA-SULU-PREVIEW-KEY
    error_template:       ~ # Example: ClientWebsiteBundle:Preview:error.html.twig
    mode:                 auto

    # Used for the delayed send of changes
    delay:                500
```

The flag `sulu_content.preview.websocket` has been replaced with `sulu_websocket.enabled`. This flag is
now default `false`.

### Content-Types

The Interface or content-types has been cleaned. The function `ContentTypeInterface::readForPreview` will never
be called in the future and can therefor be removed.

### Twig variable `request.routeParameters` removed

The `request.routeParameters` variable has been removed because it is not longer required when generate an url.

**Before**

```twig
{{ path('client_website.search', request.routeParameters) }}
```

## 1.2.7

### Default Country

The default country for addresses in the ContactBundle is set by the ISO 3166 country-code
instead the of database-id now.

## 1.2.4

### ContactRepository

A Interface for the ContactRepository has been created. Due to the refactoring
the function `appendJoins` has been changed from public to protected.
Therefore this function cannot be called anymore.

## 1.2.1

### UserRepository

The methods from the `UserProviderInterface` of Symfony have been moved to a
separate `UserProvider` implementation. Also, the `getUserInSystem` method
has been renamed to `findUserBySystem` and takes the system as an argument.

If you want to use the `Sulu` system you should inject the
`sulu_security.system` container parameter instead of hardcoding it.

## 1.2.0
{'fraction_non_alphanumeric': 0.0776912909384638, 'fraction_numerical': 0.005654281098546042, 'mean_word_length': 4.478278358809332, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 2, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3766170', 'n_tokens_mistral': 3738, 'n_tokens_neox': 3586, 'n_words': 1666}