Last modified by Super Admin on 2026/03/22 00:39

From version Icon 36.1 Icon
edited by Super Admin
on 2026/03/18 20:41
Change comment: There is no comment for this version
To version Icon 38.1 Icon
edited by Super Admin
on 2026/03/20 10:27
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -25,7 +25,7 @@
25 25   {{error}}この学校のページは既に存在します。[[既存のページを開く>>$targetPage]]{{/error}}
26 26   #else
27 27   ## 関連校として登録されているかチェック
28 - #set($affQuery = $services.query.hql("select doc.fullName, obj.affiliatedSchoolName from XWikiDocument doc, BaseObject bobj, StringProperty obj where bobj.name = doc.fullName and bobj.className = 'SeitokaiCode.SchoolClass' and obj.id.id = bobj.id and obj.id.name = 'affiliatedSchoolCode' and obj.value = :code").bindValue('code', $schoolCode))
28 + #set($affQuery = $services.query.hql("select doc.fullName, nameObj.value from XWikiDocument doc, BaseObject bobj, StringProperty obj, StringProperty nameObj where bobj.name = doc.fullName and bobj.className = 'SeitokaiCode.SchoolClass' and obj.id.id = bobj.id and obj.id.name = 'affiliatedSchoolCode' and obj.value = :code and nameObj.id.id = bobj.id and nameObj.id.name = 'affiliatedSchoolName'").bindValue('code', $schoolCode))
29 29   #set($affResults = $affQuery.execute())
30 30   #if($affResults && $affResults.size() > 0)
31 31   #set($affRow = $affResults.get(0))
... ... @@ -223,7 +223,14 @@
223 223  
224 224   // 関連校チェック(他校の関連校として登録されているか確認)
225 225   var affiliatedCheck = fetch('$request.contextPath/bin/view/SeitokaiCode/CheckAffiliated?code=' + encodeURIComponent(school.code) + '&outputSyntax=plain')
226 - .then(function(r) { return r.ok ? r.json() : { found: false }; })
226 + .then(function(r) { return r.ok ? r.text() : ''; })
227 + .then(function(t) {
228 + try {
229 + var jsonEnd = t.indexOf('}');
230 + if (jsonEnd >= 0) return JSON.parse(t.substring(0, jsonEnd + 1));
231 + } catch(e) {}
232 + return { found: false };
233 + })
227 227   .catch(function() { return { found: false }; });
228 228  
229 229   Promise.all([duplicateCheck, affiliatedCheck]).then(function(results) {