Skip to content

Commit cf05955

Browse files
committed
make things compatible to WSC 5.4
1 parent 6c6fadd commit cf05955

17 files changed

Lines changed: 28 additions & 75 deletions

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ Sometimes you want to store some data serialzed as an array but you want to have
66
The form builder introduced in WSC 5.2 is currently not able to handle this case properly, so there is some sort of workaround required.
77

88
Usage example:
9+
910
```PHP
10-
use wcf\system\form\builder\container\DummyFormContainer;
11+
use wcf\system\form\builder\container\MCDummyFormContainer;
1112
use wcf\system\form\builder\container\FormContainer;
12-
use wcf\system\form\builder\data\processor\PrefixedFormDataProcessor;
13-
use wcf\system\form\builder\NestedFormDocument;
13+
use wcf\system\form\builder\data\processor\MCPrefixedFormDataProcessor;
14+
use wcf\system\form\builder\MCNestedFormDocument;
1415
use wcf\system\form\builder\field\TextFormField;
1516

16-
$this->form = NestedFormDocument::create('DummyAdd');
17+
$this->form = MCNestedFormDocument::create('DummyAdd');
1718
$this->form->appendChildren([
18-
DummyFormContainer::create('additionalData')
19+
MCDummyFormContainer::create('additionalData')
1920
->appendChildren([
2021
FormContainer::create('foo')
2122
->label('wcf.dummy.foo')
@@ -25,7 +26,7 @@ $this->form->appendChildren([
2526
])
2627
])
2728
]);
28-
$this->form->getDataHandler()->addProcessor(new PrefixedFormDataProcessor('additionalData', 'additionalData'));
29+
$this->form->getDataHandler()->addProcessor(new MCPrefixedFormDataProcessor('additionalData', 'additionalData'));
2930
```
3031

3132
### Attention:

files/js/WoltLabSuite/Core/Form/Builder/Password.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

files/lib/system/form/builder/NestedFormDocument.class.php renamed to files/lib/system/form/builder/MCNestedFormDocument.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace wcf\system\form\builder;
44

5-
class NestedFormDocument extends FormDocument {
5+
class MCNestedFormDocument extends FormDocument {
66
/**
77
* @inheritDoc
88
*/

files/lib/system/form/builder/container/AttachmentFormContainer.class.php renamed to files/lib/system/form/builder/container/MCAttachmentFormContainer.class.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
use wcf\data\object\type\ObjectTypeCache;
77
use wcf\system\attachment\AttachmentHandler;
88
use wcf\system\event\EventHandler;
9-
use wcf\system\form\builder\field\AttachmentFormField;
9+
use wcf\system\form\builder\field\MCAttachmentFormField;
1010

11-
class AttachmentFormContainer extends FormContainer {
11+
class MCAttachmentFormContainer extends FormContainer {
1212
/**
1313
* attachment form field
14-
* @var AttachmentFormField
14+
*
15+
* @var MCAttachmentFormField
1516
*/
1617
protected $attachmentField;
1718

@@ -79,7 +80,7 @@ public function attachmentData($objectType = null, $parentObjectID = 0) {
7980
/**
8081
* Returns the form field handling attachments.
8182
*
82-
* @return AttachmentFormField
83+
* @return MCAttachmentFormField
8384
* @throws \BadMethodCallException if the form field container has not been populated yet/form has not been built yet
8485
*/
8586
public function getAttachmentField() {
@@ -135,7 +136,7 @@ public function loadValues(array $data, IStorableObject $object) {
135136
public function populate() {
136137
parent::populate();
137138

138-
$this->attachmentField = AttachmentFormField::create($this->fieldId);
139+
$this->attachmentField = MCAttachmentFormField::create($this->fieldId);
139140

140141
$this->appendChildren([
141142
$this->attachmentField

files/lib/system/form/builder/container/DummyFormContainer.class.php renamed to files/lib/system/form/builder/container/MCDummyFormContainer.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use wcf\system\WCF;
66

7-
class DummyFormContainer extends FormContainer {
7+
class MCDummyFormContainer extends FormContainer {
88
/**
99
* @inheritDoc
1010
*/

files/lib/system/form/builder/container/RecurringElementsFormContainer.class.php renamed to files/lib/system/form/builder/container/MCRecurringElementsFormContainer.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use wcf\system\form\builder\data\processor\CustomFormDataProcessor;
66
use wcf\system\form\builder\IFormDocument;
77

8-
class RecurringElementsFormContainer extends FormContainer {
8+
class MCRecurringElementsFormContainer extends FormContainer {
99
/**
1010
* @inheritDoc
1111
*/

files/lib/system/form/builder/container/RegisterFormContainer.class.php renamed to files/lib/system/form/builder/container/MCRegisterFormContainer.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace wcf\system\form\builder\container;
44

5-
class RegisterFormContainer extends FormContainer {
5+
class MCRegisterFormContainer extends FormContainer {
66
/**
77
* @inheritDoc
88
*/

files/lib/system/form/builder/data/processor/PrefixedFormDataProcessor.class.php renamed to files/lib/system/form/builder/data/processor/MCPrefixedFormDataProcessor.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace wcf\system\form\builder\data\processor;
44

55
use wcf\data\IStorableObject;
6-
use wcf\system\form\builder\container\DummyFormContainer;
6+
use wcf\system\form\builder\container\MCDummyFormContainer;
77
use wcf\system\form\builder\container\IFormContainer;
88
use wcf\system\form\builder\field\IFormField;
99
use wcf\system\form\builder\IFormDocument;
1010
use wcf\system\form\builder\IFormNode;
1111

12-
class PrefixedFormDataProcessor extends AbstractFormDataProcessor {
12+
class MCPrefixedFormDataProcessor extends AbstractFormDataProcessor {
1313
/**
1414
* processor id primarily used for error messages
1515
* @var string
@@ -49,7 +49,7 @@ public function __construct($id, $wrapperProperty, $targetProperty = '') {
4949
* @inheritDoc
5050
*/
5151
public function processFormData(IFormDocument $document, array $parameters) {
52-
/** @var DummyFormContainer $container */
52+
/** @var MCDummyFormContainer $container */
5353
$container = $document->getNodeById($this->id);
5454
if ($container === null || !$container->hasChildren()) {
5555
return $parameters;
@@ -88,7 +88,7 @@ protected function processNode(IFormNode $node, &$parameters) {
8888
* @inheritDoc
8989
*/
9090
public function processObjectData(IFormDocument $document, array $data, IStorableObject $object) {
91-
/** @var DummyFormContainer $container */
91+
/** @var MCDummyFormContainer $container */
9292
$container = $document->getNodeById($this->id);
9393

9494
$container = $document->getNodeById($this->id);

0 commit comments

Comments
 (0)