-
Notifications
You must be signed in to change notification settings - Fork 5
/
ReplacementData.php
2250 lines (1741 loc) · 97.8 KB
/
ReplacementData.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
*
* @see: https://gist.github.com/sunnysideup/6eb1727b1ce4a3a9a93e for an example of how
* data is added
*/
class ReplacementData
{
/**
*
* @param String $to - e.g. 3.0 or 3.1
* @return array like this:
* array(
* " php" = array(
* "A" => "B"
* )
* )
*/
public function __construct()
{
$this->fullArray = $this->getData(null);
$count = 0;
foreach ($this->fullArray as $to => $subArray) {
$this->tos[$to] = $to;
foreach ($subArray as $language => $subSubArray) {
$this->languages[$language] = $language;
foreach ($subSubArray as $replaceArray) {
$this->flatFindArray[$language][$language."_".$to."_".$count] = $replaceArray[0];
$this->flatReplacedArray[$language][$language."_".$to."_".$count] = $replaceArray[1];
$count++;
}
}
}
}
public function getReplacementArrays($to)
{
return $this->fullArray[$to];
}
private $fullArray = array();
public function getFullArray()
{
return $this->fullArray;
}
private $tos = array();
public function getTos()
{
return $this->tos;
}
private $languages = array();
public function getLanguages()
{
return $this->languages;
}
private $flatFindArray = array();
public function getFlatFindArray()
{
return $this->flatFindArray;
}
private $flatReplacedArray = array();
public function getFlatReplacedArray()
{
return $this->flatReplacedArray;
}
private function getData($to)
{
$array = array();
/*
* this does not seem to work!
$array["2.0"]["yaml"] = array();
$array["2.0"]["yml"] = array();
$array["2.0"]["js"] = array();
$array["2.0"]["ss"] = array();
$array["2.0"]["php"] = array(
array('method_exists(',
'method_exists(',
'It is highly recommended to change method_exists to HasMethod'
)
);
*/
$array["3.0"]["yaml"] = array();
$array["3.0"]["yml"] = array();
$array["3.0"]["js"] = array();
$array["3.0"]["ss"] = array(
array('sapphire\/',
'framework\/'),
array('<% control Menu(1)',
'<% loop Menu(1)'),
array('<% control Menu(2)',
'<% loop Menu(2)'),
array('<% control Menu(3)',
'<% loop Menu(3)'),
array('<% control Parent',
'<% with Parent'),
array('<% control SiteConfig',
'<% with SiteConfig'),
array('<% control Children',
'<% loop Children'),
array('<% control Images',
'<% loop Images'),
array('<% control Image',
'<% with Image'),
array('<% control Photos',
'<% loop Photos'),
array('<% control Photo',
'<% with Photo'),
array('<% control Pages',
'<% loop Pages'),
array('<% control Page',
'<% with Page'),
array('<% control Results',
'<% loop Results'),
array('<% control ',
'<% with/loop '),
array('<% end_control ',
'<% end_loop/with '),
array('themedCSS',
'themedCSS',
'themedCSS now includes a third parameter - and should be formatted like this: themedCSS(myCSS, myModule, myMedia (e.g. PRINT))'),
array('<% include SearchForm %>',
'<% include SearchFormFromTemplateNotMethod %>',
'If you have a template called SearchForm then you will need to rename it as it conflicts with the SearchForm method / template from Framework. Alternatively, you can replace it with [DollarSign]SearchForm (dont forget to add to _config.php: FulltextSearchable::enable();) to use the built-in search...')
);
$array["3.0"]["php"] = array(
array('Folder::findOrMake',
'Folder::find_or_make'),
array('Director::currentPage(',
'Director::get_current_page('),
array('Member::currentMember(',
'Member::currentUser('),
array('new DataObjectSet',
'new ArrayList'),
array('@return DataObjectSet',
'@return ArrayList'),
array('@param DataObjectSet',
'@param ArrayList'),
array('new FieldSet',
'new FieldList'),
array('@return FieldSet',
'@return FieldList'),
array('@param FieldSet',
'@param FieldList'),
array('DBField::create(',
'DBField::create_field('),
array('Database::alteration_message(',
'DB::alteration_message('),
array('Director::isSSL()',
'(Director::protocol()===\'https://\')'),
array('extends SSReport',
'extends SS_Report'),
array('function getFrontEndFields()',
'function getFrontEndFields($params = null)'),
array('function Breadcrumbs()',
'function Breadcrumbs($maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false)'),
array('extends DataObjectDecorator',
'extends DataExtension'),
array('extends SiteTreeDecorator',
'extends SiteTreeExtension'),
array('function updateCMSFields(FieldSet &$field)',
'function updateCMSFields(FieldList $fields'),
array('function updateCMSFields(FieldSet',
'function updateCMSFields(FieldList'),
array('function updateCMSFields(&$fields',
'function updateCMSFields(FieldList $fields'),
array('function updateCMSFields( $fields',
'function updateCMSFields( FieldList $fields'),
array('function updateCMSFields($fields',
'function updateCMSFields(FieldList $fields'),
array('function updateCMSFields( FieldSet',
'function updateCMSFields( FieldList'),
array('function updateCMSFields( &$fields',
'function updateCMSFields( FieldList $fields'),
array('function updateCMSFields( FieldSet &$field)',
'function updateCMSFields( FieldList $fields'),
array('function canEdit()',
'function canEdit($member = null)'),
array('function canView()',
'function canView($member = null)'),
array('function canCreate()',
'function canCreate($member = null)'),
array('function canDelete()',
'function canDelete($member = null)'),
array('function Field()',
'function Field($properties = array())'),
array('function sendPlain()',
'function sendPlain($messageID = null)'),
array('function send()',
'function send($messageID = null)'),
array('function apply(SQLQuery',
'function apply(DataQuery'),
array('Form::disable_all_security_tokens',
'SecurityToken::disable'),
array('Root.Content.Main',
'Root.Main'),
array('Root.Content.',
'Root.'),
array('SAPPHIRE_DIR',
'FRAMEWORK_DIR'),
array('SAPPHIRE_PATH',
'FRAMEWORK_PATH'),
array('SAPPHIRE_ADMIN_DIR',
'FRAMEWORK_ADMIN_DIR'),
array('SAPPHIRE_ADMIN_PATH',
'FRAMEWORK_ADMIN_PATH'),
array('Convert::json2array(',
'json_decode('),
array('Root.Content.Metadata',
'Root.Main'),
array('->fieldByName(\'Content\')->fieldByName(\'Main\')',
'->fieldByName(\'Main\')'),
array('->fieldByName("Content")->fieldByName("Main")',
'->fieldByName("Main")'),
array('->fieldByName(\'Content\')->fieldByName(\'Metadata\')',
'->fieldByName(\'Main\')'),
array('->fieldByName("Content")->fieldByName("Metadata")',
'->fieldByName("Main")'),
array('CMSMainMarkingFilter',
'CMSSiteTreeFilter_Search'),
array('MySQLFulltextSearchable',
'FulltextSearchable'),
array('new LeftAndMainDecorator',
'new LeftAndMainExtension'),
array('extends LeftAndMainDecorator',
'extends LeftAndMainExtension'),
array('ClassInfo::is_subclass_of(',
'is_cublass_of('),
array('getClassFile(',
'SS_ClassManifest::getItemPath('),
array('->TreeTitle(',
'->getTreeTitle('),
array('new SubstringFilter',
'new PartialMatchFilter'),
array('@return SubstringFilter',
'@return PartialMatchFilter'),
array('@param SubstringFilter',
'@param PartialMatchFilter'),
array('$ParagraphSummary',
'$Content'),
array('$ParsedContent',
'$Content'),
array('return DataObject::get_one(\'HomePage\') == null;',
'return HomePage::get()->first() ? false: true;'),
array('return DataObject::get_one("HomePage") == null;',
'return HomePage::get()->first() ? false: true;'),
array('DataObject::get_one("SiteConfig")',
'SiteConfig::current_site_config()'),
array('function updateCMSFields(FieldList &$fields)',
'function updateCMSFields(FieldList $fields)'),
array('mysql_affected_rows()',
'DB::getConn()->affectedRows()'),
array('ImageAttachmentField',
'UploadField'),
array('mysql_info()',
'mysql_info(DB::getConn())'),
# This is dangerous because custom code might call the old statics from a non page/page-controller
array('SortableDataObject',
'SortableDataObject',
'Replace SortableDataObject by adding sortable gridfield or something along those lines. SortableDataObject is part of DataObjectManager, which is not suitable for SS 3+.'),
array('ImageAttachmentField',
'ImageAttachmentField',
'Replace ImageAttachmentField with UploadField as SimpleHTMLEditorField is part of DataObjectManager'),
array('SimpleHTMLEditorField',
'SimpleHTMLEditorField',
'Replace SimpleHTMLEditorField with HTMLEditorField as SimpleHTMLEditorField is part of DataObjectManager'),
array('LeftAndMain::ForceReload',
'LeftAndMain::ForceReload',
'ForceReload method no longer exists... $this->redirectBack?'),
array('->FieldSet(',
'->FieldList(',
'For CompositeField only.'),
array('Requirements::themedCSS(',
'Requirements::themedCSS(',
'Include module name as so: themedCSS("MyCssFile", "mymodulename", "print") '),
array('Director::redirect(',
'$this->redirect(',
'this should be a controller class, otherwise use Controller::curr()->redirect'),
array('Director::redirectBack(',
'$this->redirectBack(',
' this should be a controller class, otherwise use Controller::curr()->redirectBack '),
array('Director::redirected_to(',
'$this->redirectBack(',
' this should be a controller class? '),
array('Director::set_status_code(',
'$this->setStatusCode(',
' this should be a controller class? '),
array('Director::URLParam(',
'$this->getRequest()->param(',
' is this in a controller class?'),
array('Director::URLParams(',
'$this->getRequest()->params(',
' is this in a controller class?'),
array('Member::map(',
'DataList::("Member")->map(',
' check filter = "", sort = "", blank="" '),
array('new HasManyComplexTableField',
'new GridField',
' check syntax: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param HasManyComplexTableField',
'@param GridField'),
array('@return HasManyComplexTableField',
'@return GridField'),
array('new ManyManyComplexTableField',
'new GridField',
' check syntax: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param ManyManyComplexTableField',
'@param GridField'),
array('@return ManyManyComplexTableField',
'@return GridField'),
array('new ManyManyDataObjectManager',
'new GridField',
' check syntax: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param ManyManyDataObjectManager',
'@param GridField'),
array('@return ManyManyDataObjectManager',
'@return GridField'),
array('new ComplexTableField',
'new GridField',
' check syntax: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param ComplexTableField',
'@param GridField'),
array('@return ComplexTableField',
'@return GridField'),
array('new TableListField',
'new GridField',
' check syntax: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param TableListField',
'@param GridField'),
array('@return TableListField',
'@return GridField'),
array('new ImageField(',
'new UploadField(',
' Check Syntax - see http://doc.silverstripe.org/framework/en/trunk/reference/uploadfield'),
array('@param ImageField',
'@param UploadField'),
array('@return ImageField',
'@return UploadField'),
array('DataObjectDecorator',
'DataExtension',
' check syntax'),
array('->getComponentSet(',
'->getComponentSet(',
' - check new syntax '),
array('DataObject::get(',
'DataObject::get(',
' - replace with ClassName::get( '),
array('DataObject::get_one(',
'DataObject::get_one(',
' - replace with ClassName::get()->First() '),
array('DataObject::get_by_id(',
'DataObject::get_by_id(',
' - replace with ClassName::get()->byID($id) '),
array('DB::query("SELECT COUNT(*)',
'DB::query("SELECT COUNT(*)',
' replace with MyClass::get()->count() '),
array('sapphire',
'FRAMEWORK_DIR',
' - changed from sapphire/ to framework/ - using constant preferred. '),
array('Object::set_static(',
'Config::inst()->update(',
' `Object::set_static(\'MyClass\', \'myvar\')` becomes `Config::inst()->update(\'MyClass\', \'myvar\', \'myval\')` instead. '),
array('::addStaticVars(',
'Config::inst()->update(',
' Object::addStaticVars(\'MyClass\', array(\'myvar\' => \myval\'))` should be replaced with individual calls to `Config::inst()->update()` instead. '),
array('::add_static_var(',
'Config::inst()->update(',
' Object::add_static_var(\'MyClass\', \'myvar\', \'myval\')` becomes `Config::inst()->update(\'MyClass\', \'myvar\', \'myval\')` '),
array('::set_uninherited(',
'Config::inst()->update(',
' * `Object::set_uninherited(\'MyClass\', \'myvar\', \'myval\')` becomes `Config::inst()->update(\'MyClass\', \'myvar\', \'myval\')` instead. '),
array('::get_static(',
'Config::inst()->get(',
' `Object::get_static(\'MyClass\', \'myvar\')` becomes `Config::inst()->get(\'MyClass\', \'myvar\', Config::FIRST_SET)` '),
array('::uninherited_static(',
'Config::inst()->get(',
' Object::uninherited_static(\'MyClass\', \'myvar\')` becomes `Config::inst()->get(\'MyClass\', \'myvar\', Config::UNINHERITED)` '),
array('::combined_static(',
'Config::inst()->get(',
' `Object::combined_static(\'MyClass\', \'myvar\')` becomes `Config::inst()->get(\'MyClass\', \'myvar\')` (no option as third argument) '),
array('function extraStatics',
'function extraStatics',
' Remove me: simply define static vars on extension directly, or use add_to_class() '),
array('extendedSQL(',
'extendedSQL(',
' - Use ->dataQuery()->query() on DataList if access is needed to SQLQuery (see syntax) '),
array('->buildSQL(',
'->buildSQL(',
' - Use ->dataQuery()->query() on DataList if access is needed to SQLQuery (see syntax) '),
array('SQLQuery(',
'SQLQuery(',
' Internal properties: ($from, $select, $where, $orderby, $groupby, $having, $limit, $distinct, $delete, $connective) now use getters, setters and adders. e.g. getFrom(), setFrom(), addFrom(), getLimit(), setLimit().\n innerJoin() has been renamed to addInnerJoin(), leftJoin() renamed to addLeftJoin() '),
array('DataObject::Aggregate(',
'DataObject::Aggregate(',
'`DataObject::Aggregate()` and `DataObject::RelationshipAggregate()` are now deprecated. To replace your deprecated aggregate calls
in PHP code, you should query with something like `Member::get()->max(\'LastEdited\')`, that is, calling the aggregate on the `DataList` directly.
The same concept applies for replacing `RelationshipAggregate()`, just call the aggregate method on the relationship instead,
so something like `Member::get()->Groups()->max(\'LastEdited\')`.
For partial caching in templates, the syntax `<% cached Aggregate(Page).Max(LastEdited) %>` has been deprecated. The new syntax is similar,
except you use `List()` instead of `Aggregate()`, and the aggregate call `Max()` is now lowercase, as in `max()`.
An example of the new syntax is `<% cached List(Page).max(LastEdited) %>`. Check `DataList` class for more aggregate methods to use.'),
array('DataObject::RelationshipAggregate(',
'DataObject::RelationshipAggregate(',
'`DataObject::Aggregate()` and `DataObject::RelationshipAggregate()` are now deprecated. To replace your deprecated aggregate calls
in PHP code, you should query with something like `Member::get()->max(\'LastEdited\')`, that is, calling the aggregate on the `DataList` directly.
The same concept applies for replacing `RelationshipAggregate()`, just call the aggregate method on the relationship instead,
so something like `Member::get()->Groups()->max(\'LastEdited\')`.
For partial caching in templates, the syntax `<% cached Aggregate(Page).Max(LastEdited) %>` has been deprecated. The new syntax is similar,
except you use `List()` instead of `Aggregate()`, and the aggregate call `Max()` is now lowercase, as in `max()`.
An example of the new syntax is `<% cached List(Page).max(LastEdited) %>`. Check `DataList` class for more aggregate methods to use.'),
array('->CurrentMember(',
'->CurrentMember(',
' Replace with Member::currentUser() '),
array('->getSecurityID(',
'->getSecurityID(',
' Replace with SecurityToken::inst()->getValue() '),
array('->HasPerm(',
'->HasPerm(',
' Replace with Permission::check($code) '),
array('->BaseHref(',
'->BaseHref(',
' Replace with Director::absoluteBaseURL() '),
array('->AbsoluteBaseURL(',
'->AbsoluteBaseURL(',
' Replace with Director::absoluteBaseURL() '),
array('->IsAjax',
'->IsAjax',
' Replace with Director::is_ajax() '),
array('->i18nLocale(',
'->i18nLocale(',
' Replace with i18n::get_locale() '),
array('->CurrentPage(',
'->CurrentPage(',
' Replace with Controller::curr() '),
array('->getCMSFields(array',
'->getCMSFields(array',
' Remove parameters: Need to customize FormScaffolder directly'),
array('->getCMSFields($',
'->getCMSFields($',
' Remove parameters: Need to customize FormScaffolder directly'),
array('->getCMSFields( $',
'->getCMSFields( $',
' Remove parameters: Need to customize FormScaffolder directly'),
array('->getCMSFields( array',
'->getCMSFields( array',
' Remove parameters: Need to customize FormScaffolder directly'),
array('root.Behaviour',
'root.Behaviour',
' Custom fields in the behaviour and access tabs should now be added using getSettingsFields and updateSettingsFields (in DataExtensions) '),
array('root.Access',
'root.Access',
' Custom fields in the behaviour and access tabs should now be added using getSettingsFields and updateSettingsFields (in DataExtensions) '),
array('extends ModelAdmin',
'extends ModelAdmin',
' Review docs for new ModelAdmin usage '),
array('->addExtraClass(',
'->addExtraClass(',
' CHECK FOR PREVIOUS USE OF INCONSISTENCIES: CSS class names applied through FormField->addExtraClass()
and the "type" class are now consistently added to the container `<div>`
as well as the HTML form element itself. '),
array('extends Validator',
'extends Validator',
' Note that javascript client-side validation is no longer supported. Specifically the javascript() method will no longer be of any use. '),
array('Validator::set_javascript_validation_handler(',
'Validator::set_javascript_validation_handler(',
' Deprecated. No longer available. '),
array('new TextareaField',
'new TextareaField',
' $form, $maxLength, $rightTitle, $rows/$cols optional constructor arguments must now be set using setters on the instance of the field. '),
array('new HtmlEditorField',
'new HtmlEditorField',
' $form, $maxLength, $rightTitle, $rows/$cols optional constructor arguments must now be set using setters on the instance of the field. '),
array('extends TextareaField',
'extends TextareaField',
' Note: $form, $maxLength, $rightTitle, $rows/$cols optional constructor arguments must now be set using setters on the instance of the field. '),
array('extends HtmlEditorField',
'extends HtmlEditorField',
' Note: $form, $maxLength, $rightTitle, $rows/$cols optional constructor arguments must now be set using setters on the instance of the field. '),
array('new FileField',
'new FileField',
' $folderName optional constructor argument must now be set using a setter on the instance of the field.'),
array('extends FileField',
'extends FileField',
' Note: $folderName optional constructor argument must now be set using a setter on the instance of the field.'),
array('new SimpleImageField',
'new FileIframeField',
' Use UploadField instead. Note: $folderName optional constructor argument must now be set using a setter on the instance of the field.\nAlso recommended to use UploadField with setAllowedExtensions instead.\nSee http://doc.silverstripe.org/framework/en/trunk/reference/uploadfield for more details.'),
array('@param SimpleImageField',
'@param FileIframeField'),
array('@return SimpleImageField',
'@return FileIframeField'),
array('new FileIframeField',
'new FileIframeField',
' Use UploadField instead. See: http://doc.silverstripe.org/framework/en/trunk/reference/uploadfield for more details. '),
array('extends Widget',
'extends Widget',
' Make sure silverstripe-widgets module is installed '),
array('new Widget',
'new Widget',
' Make sure silverstripe-widgets module is installed '),
array('extends NZGovtPasswordValidator',
'extends NZGovtPasswordValidator',
' Make sure silverstripe-securityextras module is installed '),
array('new NZGovtPasswordValidator',
'new NZGovtPasswordValidator',
' Make sure silverstripe-securityextras module is installed '),
array('extends GeoIP',
'extends GeoIP',
' Make sure silverstripe-geoip module is installed '),
array('new GeoIP',
'new GeoIP',
' Make sure silverstripe-geoip module is installed '),
array('static $api_access =',
'static $api_access =',
' Make sure silverstripe-restfulserver and silverstripe-soapserver are installed. '),
array('$Comments',
'$Comments',
' Make sure silverstripe-comments module is installed.'),
array('->Comments',
'->Comments',
' Make sure silverstripe-comments module is installed.'),
array('$lang[',
'$lang[',
' Move translations to YAML translation file. See: https://github.com/chillu/i18n_yml_converter'),
array('extends SS_Report',
'extends SS_Report',
' No longer need to ::register reports. Silverstripe does this automatically. Reports can be excluded using SS_Report::add_excluded_reports()\nSQLQuery\'s are also unavailable. Use DataLists instead. '),
array('extends SapphireTest',
'extends SapphireTest',
' Note: Unit tests require definition of used `DataObject` and `Extension` classes using SapphireTest->extraDataObjects and SapphireTest->requiredExtensions '),
array('static $breadcrumbs_delimiter',
'static $breadcrumbs_delimiter',
' Need to remove this and create a template to customize breadcrumbs now. '),
array('new AdvancedSearchForm',
'new AdvancedSearchForm',
' Removed. Can extend SearchForm to get similar functionality '),
array('new Archive',
'new Archive',
' To continue use of this, you will need to copy the class from 2.4.'),
array('new TarballArchive',
'new TarballArchive',
' To continue use of this, you will need to copy the class from 2.4.'),
array('new AssetTableField',
'new GridField',
' Use GridFieldConfig_RelationEditor & see syntax'),
array('new ComponentSet',
'new ComponentSet',
' Replace with ManyManyList or HasManyList '),
array('new CustomRequiredFields',
'new RequiredFields',
' See syntax '),
array('new DataObjectLog',
'new DataObjectLog',
' Removed: no replacement.'),
array('new MemberTableField',
'new GridField',
' check syntax and use GridFieldConfig_RelationEditor '),
array('new Notifications',
'new Notifications',
' To continue use of this, you will need to copy the class from 2.4.'),
array('new QueuedEmail',
'new QueuedEmail',
' To continue use of this, you will need to copy the class from 2.4.'),
array('new RestrictedTextField',
'new RestrictedTextField',
' Removed: use custom fields instead.'),
array('new UniqueTextField',
'new UniqueTextField',
' Removed: use custom fields instead.'),
array('new UniqueRestrictedTextField',
'new UniqueRestrictedTextField',
' Removed: use custom fields instead.'),
array('new AutocompleteTextField',
'new AutocompleteTextField',
' Removed: use custom fields instead.'),
array('new ConfirmedFormAction',
'new ConfirmedFormAction',
' Removed: use custom fields instead.'),
array('new TreeSelectorField',
'new TreeDropdownField',
' check syntax'),
array('new SQLMap',
'new SS_Map',
' check syntax'),
array('new XML',
'new XML',
' Removed: Use PHP\'s built-in SimpleXML instead '),
array('Director::set_dev_servers(',
'Director::set_dev_servers(',
'Use Director::set_environment_type() or an _ss_environment.php instead.'),
array('Director::set_test_servers(',
'Director::set_test_servers(',
'Use Director::set_environment_type() or an _ss_environment.php instead.'),
array('->getPageLimits(',
'->getPageLimits(',
'Use getPageStart, getPageLength, or getTotalItems instead.'),
/*
array('->dataFieldByName(',
'->dataFieldByName(',
'Use Fields() and FieldList API instead.'),
*/
array('->unsetDataFieldByName(',
'->unsetDataFieldByName(',
'Use Fields() and FieldList API instead.'),
array('->unsetFieldFromTab(',
'->unsetFieldFromTab(',
'Use Fields() and FieldList API instead.'),
array('->resetField(',
'->resetField(',
'Use Fields() and FieldList API instead.'),
array('->unsetActionByName(',
'->unsetActionByName(',
'Use Actions() and FieldList API instead.'),
array('->FormEncType(',
'->FormEncType(',
'Please use Form->getEncType() instead.'),
array('->Name(',
'->getName(',
'Use getName() for FormField '),
array('->setTabIndex(',
'->setAttribute(',
'Use setAttribute("tabindex") instead'),
array('->getTabIndex(',
'->getAttribute(',
'Use getAttribute("tabindex") instead'),
array('->createTag(',
'->createTag(',
'(FormField) Please define your own FormField template using setFieldTemplate() '),
array('->describe(',
'->setDescription(',
'(FormField) Use setDescription()'),
array('new ImageFormAction',
'new ImageFormAction',
'Use FormAction wtih setAttribute("src", "myimage.png") and custom JavaScript to achieve hover effect'),
array('extends ImageFormAction',
'extends ImageFormAction',
'Use FormAction wtih setAttribute("src", "myimage.png") and custom JavaScript to achieve hover effect'),
array('->startClosed(',
'->setStartClosed(',
'(ToggleCompositeField)'),
array('->join(',
'->join(',
'(DataList/DataQuery) use innerJoin() or leftJoin() instead'),
array('->setComponent(',
'->setComponent(',
'(DataObject) No longer in use (no replacement)'),
array('->instance_get(',
'->instance_get(',
'(DataObject) Use DataList::create and DataList to do your querying instead.'),
array('->instance_get_one(',
'->instance_get_one(',
'(DataObject) Use DataList::create($this->class)->where($filter)->sort($orderby)->First() instead.'),
array('->buildDataObjectSet(',
'->buildDataObjectSet(',
'(DataObject) Use DataList to do your querying instead.'),
array('->databaseFields(',
'->databaseFields(',
'(DataObject) Use DataObject::database_fields() instead.'),
array('->customDatabaseFields(',
'->customDatabaseFields(',
'(DataObject) Use DataObject::custom_database_fields() instead.'),
array('->Lower(',
'->LowerCase(',
'(StringField)'),
array('->Upper(',
'->UpperCase(',
'(StringField)'),
array('->EscapeXML(',
'->EscapeXML(',
'(Text) Use DBField->XML() instead.'),
array('->getArray(',
'->getArray(',
'(ArrayData) Use ArrayData::toMap() instead.'),
array('LeftAndMain::set_loading_image(',
'LeftAndMain::set_loading_image(',
'Removed (no explanation)'),
array('->isAdmin()',
'->inGroup("ADMIN")'),
array('->isAdmin(',
'->inGroup(',
'Use ->inGroup("ADMIN") instead'),
array('->getRange(',
'->limit(',
'NOTE: getRange uses (offset, length) - similar to mysql and limit uses (length, offset) - swapsies!!!'),
//MUST TO LAST
array('->map(',
'->map(',
' map returns SS_Map and not an Array use ->map->toArray to get Array '),
array('->toDropDownMap(',
'->toDropDownMap(',
'Use ->map()->toArray() instead'),
array('new DataObjectManager',
'new GridField',
'replace DataObjectManager with a gridfield: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param DataObjectManager',
'@param GridField'),
array('@return DataObjectManager',
'@return GridField'),
array('new ImageDataObjectManager',
'new GridField',
'replace ImageDataObjectManager with a Gridfield: http://doc.silverstripe.org/framework/en/reference/grid-field'),
array('@param ImageDataObjectManager',
'@param GridField'),
array('@return ImageDataObjectManager',
'@return GridField'),
array('::set_',
':\n ',
'consider setting statics through yml files, see http://doc.silverstripe.com/framework/en/topics/configuration, OR change MyClass:set_my_var(1) to Config::inst()->update->("MyClass", "my_var", 1); '),
array('DataObject::get_one',
'DataObject::TEMPORARY_CHANGE_get_one'),
array('::get_',
'::get_',
'consider getting statics using Config system... e.g. Config::inst()->get("MyClass", "MyVar"); - see http://doc.silverstripe.com/framework/en/topics/configuration'),
array('DataObject::TEMPORARY_CHANGE_get_one',
'DataObject::get_one'),
array('DataObjectManager_Popup',
'DataObjectManager_Popup',
'This is part of the Data Object Manager Module, you need to replace it (or just delete it).'),
array('LeftAndMain::setApplicationName',
'LeftAndMain::setApplicationName',
'Use the _config/config.yml file to set the application name: LeftAndMain.application_name'),
array('LeftAndMain::setLogo',
'LeftAndMain::setLogo',
'Use the _config/config.yml file to set logo related stuff: LeftAndMain.application_link AND use CSS to change the logo...'),
array('Requirements::set_write_js_to_body',
'',
'This is no longer in use.'),
array('extends ImageField',
'extends UploadField',
'Please review class as Upload field is very different from the old ImageField'),
array('->setDefaultFolder',
'->setFolderName',
'consider changing setDefaultFolder to setFolderName for Uploadfields, FileField and HtmlEditorField'),
array('FileAttachmentField',
'UploadField',
'Check parameters for this change from FileAttachmentField to UploadField'),
array('->setCanUploadNewFile',
'',
'setCanUploadNewFile does not exist on UploadField, please use equivalent.'),
array('SimpleTinyMCEField',
'HTMLEditorField',
'SimpleTinyMCEField is part of DataObject Manager and so it is unlikely to be available in a 3.0+ set up (DataObject Manager was replaced by GridField).'),
array('->setPageSize',
'',
'setPageSize is likely to have been used in a Complex Table Field, or similar, in the GridField the page size is specified as the first parameter of the Config Instantiation (e.g. GridFieldConfig_RelationEditor::create(40)).'),