| @@ -105,8 +105,19 @@ | ||
| 105 | 105 | ]; |
| 106 | 106 | |
| 107 | 107 | public static $scopeType = 'text'; |
| 108 | 108 | |
| 109 | + /** | |
| 110 | + * The types a /post/{slug} URL can serve. | |
| 111 | + * | |
| 112 | + * fcom_posts is shared: it also holds course_lesson, course_section and | |
| 113 | + * space_page rows, and each of those owns a different route. Any lookup that | |
| 114 | + * drops the type global scope to reach image and article posts must narrow to | |
| 115 | + * this list, or a feed URL can answer with a lesson or a page that happens to | |
| 116 | + * share the slug. Add a new feed shape here when one is introduced. | |
| 117 | + */ | |
| 118 | + public static $feedViewTypes = ['text', 'image', 'article']; | |
| 119 | + | |
| 109 | 120 | public static function boot() |
| 110 | 121 | { |
| 111 | 122 | parent::boot(); |
| 112 | 123 | |
| @@ -155,9 +166,9 @@ | ||
| 155 | 166 | // get the first 40 char from the title |
| 156 | 167 | $title = mb_substr($title, 0, 40, 'UTF-8'); |
| 157 | 168 | } else { |
| 158 | 169 | // get the first 25 char from the message |
| 159 | - $title = mb_substr($newModel->message, 0, 40, 'UTF-8'); | |
| 170 | + $title = mb_substr((string) $newModel->message, 0, 40, 'UTF-8'); | |
| 160 | 171 | } |
| 161 | 172 | |
| 162 | 173 | $title = Helper::normalizeToAscii($title); |
| 163 | 174 | $title = remove_accents($title); |