Ticket #4435: ctf-translatable-fix.patch
| File ctf-translatable-fix.patch, 2.7 KB (added by sminnee, 4 years ago) |
|---|
-
cms/code/CMSMain.php
431 431 $readonlyFields = $form->Fields()->makeReadonly(); 432 432 $form->setFields($readonlyFields); 433 433 } 434 435 // Set locale in the form action, so that CTFs in the child form, etc, work 436 if(Translatable::is_enabled()) { 437 $locale = Translatable::get_current_locale(); 438 if($locale != Translatable::default_locale()) { 439 $form->setFormAction(Controller::join_links($form->FormAction(), "?locale=" 440 . htmlentities($locale))); 441 } 442 } 434 443 435 444 return $form; 436 445 } else if($id) { -
sapphire/forms/ComplexTableField.php
364 364 365 365 366 366 function AddLink() { 367 return $this->Link() . '/add';367 return Controller::join_links($this->Link(), '/add'); 368 368 } 369 369 370 370 /** … … 650 650 $message = sprintf( 651 651 _t('ComplexTableField.SUCCESSADD', 'Added %s %s %s'), 652 652 $childData->singular_name(), 653 '<a href="' . $this->Link() . '/item/' . $childData->ID . '/edit">' . $childData->Title . '</a>', 653 '<a href="' . Controller::join_links($this->Link(), '/item/' . $childData->ID . '/edit') 654 . '">' . $childData->Title . '</a>', 654 655 $closeLink 655 656 ); 656 657 … … 674 675 ); 675 676 676 677 function Link() { 677 return $this->ctf->Link() . '/item/' . $this->itemID;678 return Controller::join_links($this->ctf->Link(), '/item/' . $this->itemID); 678 679 } 679 680 680 681 function __construct($ctf, $itemID) { … … 883 884 } 884 885 for($i = $offset;$i <= $offset + $this->pageSize && $i <= $this->totalCount;$i++) { 885 886 $start = $i - 1; 886 $links['link'] = Controller::join_links($this->Link() ."$this->methodName?ctf[start]={$start}");887 $links['link'] = Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}"); 887 888 $links['number'] = $i; 888 889 $links['active'] = $i == $currentItem ? false : true; 889 890 $result->push(new ArrayData($links)); … … 983 984 } 984 985 985 986 function Link() { 986 return $this->parent->Link() . '/item/' . $this->item->ID;987 return Controller::join_links($this->parent->Link(), '/item/' . $this->item->ID); 987 988 } 988 989 989 990 function EditLink() { 990 return $this->Link() . "/edit";991 return Controller::join_links($this->Link(), "/edit"); 991 992 } 992 993 993 994 function ShowLink() { 994 return $this->Link() . "/show";995 return Controller::join_links($this->Link(), "/show"); 995 996 } 996 997 997 998 function DeleteLink() { 998 return $this->Link() . "/delete";999 return Controller::join_links($this->Link(), "/delete"); 999 1000 } 1000 1001 1001 1002 /**
