Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
afi
opacce
Commits
7235fd83
Commit
7235fd83
authored
Mar 23, 2020
by
Laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev#102397 : Facets : The thesaurii Id cannot take more than 10000 values
parent
0582a0dd
Pipeline
#9726
passed with stage
in 49 minutes and 19 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
VERSIONS_WIP/102397
VERSIONS_WIP/102397
+1
-0
library/Class/CodifThesaurus.php
library/Class/CodifThesaurus.php
+3
-2
tests/library/Class/CodifThesaurusTest.php
tests/library/Class/CodifThesaurusTest.php
+11
-5
No files found.
VERSIONS_WIP/102397
0 → 100644
View file @
7235fd83
- ticket #102397 : Le nombre d'entrées pour les facettes dynamiques peut maintenant aller jusqu'à 1 679 615 (au lieu de 9 999 auparavant).
\ No newline at end of file
library/Class/CodifThesaurus.php
View file @
7235fd83
...
...
@@ -243,9 +243,10 @@ class CodifThesaurusLoader extends Storm_Model_Loader {
public
function
incrementId
(
$id
)
{
$last
=
substr
(
$id
,
strlen
(
$id
)
-
4
);
$last
=
base_convert
(
substr
(
$id
,
strlen
(
$id
)
-
4
)
,
36
,
10
)
;
$first_part
=
substr
(
$id
,
0
,
strlen
(
$id
)
-
4
);
$last
++
;
$last
=
strtoupper
(
base_convert
(
$last
,
10
,
36
));
return
$first_part
.
$this
->
getCodeSur4Chiffres
(
$last
,
true
);
}
...
...
@@ -731,7 +732,7 @@ class Class_CodifThesaurus extends Storm_Model_Abstract {
$this
->
checkAttribute
(
'id_thesaurus'
,
$my_key
!=
$empty_key
,
$this
->
_
(
'Nombre maximum d\'élément à ce niveau déjà atteint (%s)'
,
str_repeat
(
'
9
'
,
self
::
ID_KEY_LENGTH
)));
str_repeat
(
'
Z
'
,
self
::
ID_KEY_LENGTH
)));
}
...
...
tests/library/Class/CodifThesaurusTest.php
View file @
7235fd83
...
...
@@ -58,14 +58,20 @@ class CodifThesaurusCommonTest extends ModelTestCase {
/** @test */
public
function
incrementYYYY0
001
ShouldReturnYYYY0
002
()
{
$this
->
assertEquals
(
'YYYY
1000
'
,
Class_CodifThesaurus
::
incrementId
(
'YYYY0999'
));
public
function
incrementYYYY0
999
ShouldReturnYYYY0
99A
()
{
$this
->
assertEquals
(
'YYYY
099A
'
,
Class_CodifThesaurus
::
incrementId
(
'YYYY0999'
));
}
/** @test */
public
function
incrementYYYY00ZZShouldReturnYYYY0100
()
{
$this
->
assertEquals
(
'YYYY01AA'
,
Class_CodifThesaurus
::
incrementId
(
'YYYY00ZZ'
));
$this
->
assertEquals
(
'YYYY0100'
,
Class_CodifThesaurus
::
incrementId
(
'YYYY00ZZ'
));
}
/** @test */
public
function
incrementYYYY0009ShouldReturnYYYY000A
()
{
$this
->
assertEquals
(
'YYYY000A'
,
Class_CodifThesaurus
::
incrementId
(
'YYYY0009'
));
}
...
...
@@ -203,7 +209,7 @@ class CodifThesaurusTooManyValuesTest extends ModelTestCase {
'rules'
=>
null
]);
$this
->
fixture
(
'Class_CodifThesaurus'
,
[
'id_thesaurus'
=>
'TEST
9999
'
,
[
'id_thesaurus'
=>
'TEST
ZZZZ
'
,
'id_origine'
=>
'RIME'
,
'libelle'
=>
'rime'
,
'code'
=>
'TEST'
,
...
...
@@ -215,7 +221,7 @@ class CodifThesaurusTooManyValuesTest extends ModelTestCase {
/** @test */
public
function
shouldNotInsertMoreThan
9999
Child
()
{
public
function
shouldNotInsertMoreThan
ZZZZ
Child
()
{
Class_CodifThesaurus
::
find
(
723
)
->
getOrCreateChild
(
strtoupper
(
'métiers de la recherche'
),
'métiers de la recherche'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment