Commit 7978e554 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch 'master' into staging

* master:
  Fixed saving crop blurbs and updated headings display in free-text
  lower() doesn't hit database index
  Increased Accession#cropName field size and added REST API taxonomy record 'sanitizer'
  Updating taxonomy must not reuse existing data
parents 08a0bbc3 f63b18ed
......@@ -132,14 +132,15 @@ public class CropController extends BaseController {
}
@RequestMapping(value = "/{shortName}/update", method = RequestMethod.POST)
public String update(ModelMap model, @PathVariable(value = "shortName") String shortName, @RequestParam("cropName") String cropName,
public String update(ModelMap model, @PathVariable(value = "shortName") String shortName, @RequestParam(value = "cropName", required = false) String cropName,
@RequestParam("blurp") String aboutBody, @RequestParam(value = "summary", required = false) String summary) {
_logger.debug("Updating crop " + shortName);
Crop crop = cropService.getCrop(shortName);
if (crop == null) {
_logger.debug("Creating crop " + shortName + " " + cropName);
crop = cropService.addCrop(shortName, cropName, null, null);
}
_logger.debug("Updating crop blurb " + shortName);
cropService.updateBlurp(crop, aboutBody, summary, getLocale());
......@@ -209,8 +210,7 @@ public class CropController extends BaseController {
}
@RequestMapping("/{shortName}/data")
public String viewData(ModelMap model, @PathVariable(value = "shortName") String shortName,
@RequestParam(value = "page", required = false, defaultValue = "1") int page) {
public String viewData(ModelMap model, @PathVariable(value = "shortName") String shortName, @RequestParam(value = "page", required = false, defaultValue = "1") int page) {
_logger.warn("Viewing crop " + shortName);
final Crop crop = cropService.getCrop(shortName);
if (crop == null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment