2017-03-01 2 views
0

56 개 카테고리를 만들었으며 내가 원하는 카테고리를 선택할 때 새 게시물을 만들려고 할 때만 50 개가 있습니다. 다른 6 개는 없습니다. 나타나지 않고 존재하지 않는 것과 같은 범주 이름을 입력하여 선택할 수 없습니다.
어떻게 해결할 수 있습니까?
다음은 모델admin ui에서 선택시 50 개 이상의 항목 표시

var keystone = require('keystone'); 
var Types = keystone.Field.Types; 

/** 
* Post Model 
* ========== 
*/ 

var Post = new keystone.List('Post', { 
    map: { name: 'title' }, 
    autokey: { path: 'slug', from: 'title', unique: true }, 
}); 

Post.add({ 
    title: { type: String, required: true }, 
    categories: { type: Types.Relationship, ref: 'PostCategory', many: true},// <- This is Shows only 50 instead of 56! 
    state: { type: Types.Select, options: 'draft, published, archived', default: 'published', index: true, required: true }, 
    publishedDate: { type: Types.Date, index: true, default: Date.now, required: true, dependsOn: { state: 'published' } }, 
    mainPDF: { type: Types.LocalFile, dest: 'public/pdf/mainpdf'}, 
    pronunciations: { type: Types.LocalFile, dest: 'public/pdf/pronunciations'}, 
    answers: { type: Types.LocalFile, dest: 'public/pdf/answers' }, 
}} 
    }); 

Post.schema.virtual('content.full').get(function() { 
    return this.content.extended || this.content.brief; 
}); 
Post.defaultColumns = 'title,categories|20%, publishedDate|20%'; 
Post.register(); 

답변

1

당신은 /node_modules/keystone/admin/api/list.js 파일을 수정하고 (라인 (26) 주위)에 case: 'autocomplete' 라인에서 처음 세 줄을 주석 할 수있다. 키스톤 3에서만 작동합니다. 나는 이것이 문제인지 아니면 Keystone 4인지, 또는 그것이 있다면 (이 파일이 다른 위치에 있고 찾지 못했음) 그것을 해결하는 방법을 모른다.

case 'autocomplete': 
    // var limit = Number(req.query.limit) || 50; 
    // var page = Number(req.query.page) || 1; 
    // var skip = limit * (page - 1); 

Keystone 3을 포크로 만들고 NPM에 호스트하지 않는 한 package.json에서 Keystone online (Heroku, Digital Ocean, Amazon S3)을 다운로드하는 경우 이것이 가능하지 않다고 생각합니다.

+0

잘 때 내가 충돌했다 줄 주석하지만 지금은 100 제한을 변경했습니다 도움을 위해 thnx – Bill

관련 문제