protected function setSubmittedJson($field)
    {
        $json = $this->getSubmitted($field);

        if (isset($json)) {
            $decoded = json_decode($json, true);
            if (json_last_error() === JSON_ERROR_NONE) {
                $this->setSubmitted($field, $decoded);
            } else {
                $decoded = json_decode(base64_decode($json), true);
                if (json_last_error() !== JSON_ERROR_NONE) {
                    throw new InvalidArgumentException('Failed to decode the submitted JSON string');
                }
                $this->setSubmitted($field, $decoded);
            }
        }
    }