@@ -45,9 +45,8 @@ class PartialUserFormController extends UserDefinedFormController
45
45
* Partial form
46
46
*
47
47
* @param HTTPRequest $request
48
- * @return DBHTMLText|void
49
- * @throws HTTPResponse_Exception
50
48
* @return HTTPResponse|DBHTMLText|void
49
+ * @throws HTTPResponse_Exception
51
50
* @throws Exception
52
51
*/
53
52
public function partial (HTTPRequest $ request )
@@ -135,35 +134,7 @@ public function setData($request)
135
134
$ this ->dataRecord = DataObject::get_by_id ($ partial ->UserDefinedFormClass , $ partial ->UserDefinedFormID );
136
135
$ this ->setFailover ($ this ->dataRecord );
137
136
138
- $ form = $ this ->Form ();
139
- $ fields = $ partial ->PartialFields ()->map ('Name ' , 'Value ' )->toArray ();
140
- $ form ->loadDataFrom ($ fields );
141
-
142
- // Copied from {@link UserDefinedFormController}
143
- if ($ this ->Content && $ form && !$ this ->config ()->disable_form_content_shortcode ) {
144
- $ hasLocation = stristr ($ this ->Content , '$UserDefinedForm ' );
145
- if ($ hasLocation ) {
146
- /** @see Requirements_Backend::escapeReplacement */
147
- $ formEscapedForRegex = addcslashes ($ form ->forTemplate (), '\\$ ' );
148
- $ content = preg_replace (
149
- '/(<p[^>]*>)? \\$UserDefinedForm(< \\/p>)?/i ' ,
150
- $ formEscapedForRegex ,
151
- $ this ->Content
152
- );
153
-
154
- return $ this ->customise ([
155
- 'Content ' => DBField::create_field ('HTMLText ' , $ content ),
156
- 'Form ' => '' ,
157
- 'PartialLink ' => $ partial ->getPartialLink ()
158
- ])->renderWith ([static ::class, Page::class]);
159
- }
160
- }
161
-
162
- return $ this ->customise ([
163
- 'Content ' => DBField::create_field ('HTMLText ' , $ this ->Content ),
164
- 'Form ' => $ form ,
165
- 'PartialLink ' => $ partial ->getPartialLink ()
166
- ])->renderWith ([static ::class, Page::class]);
137
+ return $ partial ;
167
138
}
168
139
169
140
/**
0 commit comments