Я работаю над проектом PHP, который вставляет данные в базу данных MySQL с помощью расширения mysqli. Однако во время выполнения я столкнулся со следующей ошибкой:
Код: Выделить всё
Fatal error: Uncaught mysqli_sql_exception: Duplicate entry '0-472-michalina-ludmi-a-musielakv-erh-lt-den-meistersch-ler-i...' for key 'idx_client_id_parent_id_alias_language' in /var/www/html/Database/Write_DB_PressArticles.php:198
Код: Выделить всё
// Variables for workflow_associations table
$pressItem_ID = $currentPressID; // Overwrite during insert
$pressStage_ID = 1;
$pressExtension = 'com_content.article';
// Variables for menu table
$pressMenuType = 'main-menu-de';
//$pressTitle = ...;
//$pressAlias = ...;
$pressPath = 'newsportal/' . $pressAlias . ' / ' ; < b r / > $ p r e s s L i n k = ' ' ; < b r / > $ p r e s s T y p e = ' c o m p o n e n t ' ; < b r / > / / $ p r e s s P u b l i s h e d = . . . ; < b r / > $ p r e s s M e n u P a r e n t I D = 4 7 2 ; < b r / > $ p r e s s M e n u L e v e l = 2 ; < b r / > $ p r e s s C o m p o n e n t I D = 2 2 ; < b r / > $ p r e s s C h e c k e d O u t = 8 8 ; < b r / > $ p r e s s C h e c k e d O u t T i m e = $ n o w ; < b r / > $ p r e s s B r o w s e N a v = 0 ; < b r / > $ p r e s s M e n u A c c e s s = 1 ; < b r / > $ p r e s s M e n u I m g = ' ' ; < b r / > $ p r e s s T e m p l a t e S t y l e I D = 0 ; < b r / > $ p r e s s M e n u P a r a m s = ' { & q u o t ; l a y o u t _ t y p e & q u o t ; : & q u o t ; b l o g & q u o t ; , & q u o t ; s h o w _ c a t e g o r y _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ d e s c r i p t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ d e s c r i p t i o n _ i m a g e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m a x L e v e l & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ e m p t y _ c a t e g o r i e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ n o _ a r t i c l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ c a t e g o r y _ h e a d i n g _ t i t l e _ t e x t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ s u b c a t _ d e s c & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ c a t _ n u m _ a r t i c l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ c a t _ t a g s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; n u m _ l e a d i n g _ a r t i c l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; b l o g _ c l a s s _ l e a d i n g & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; n u m _ i n t r o _ a r t i c l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; b l o g _ c l a s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; n u m _ c o l u m n s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m u l t i _ c o l u m n _ o r d e r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; n u m _ l i n k s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ f e a t u r e d & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; l i n k _ i n t r o _ i m a g e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ s u b c a t e g o r y _ c o n t e n t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; o r d e r b y _ p r i & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; o r d e r b y _ s e c & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; o r d e r _ d a t e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ p a g i n a t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ p a g i n a t i o n _ r e s u l t s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a r t i c l e _ l a y o u t & q u o t ; : & q u o t ; _ : d e f a u l t & q u o t ; , & q u o t ; s h o w _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; l i n k _ t i t l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ i n t r o & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; i n f o _ b l o c k _ p o s i t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; i n f o _ b l o c k _ s h o w _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ c a t e g o r y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; l i n k _ c a t e g o r y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ p a r e n t _ c a t e g o r y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; l i n k _ p a r e n t _ c a t e g o r y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ a s s o c i a t i o n s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ a u t h o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; l i n k _ a u t h o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ c r e a t e _ d a t e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ m o d i f y _ d a t e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ p u b l i s h _ d a t e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ i t e m _ n a v i g a t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ r e a d m o r e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ r e a d m o r e _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ h i t s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ t a g s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ n o a u t h & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ f e e d _ l i n k & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; f e e d _ s u m m a r y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u - a n c h o r _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u - a n c h o r _ c s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u _ i c o n _ c s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u _ i m a g e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u _ i m a g e _ c s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u _ t e x t & q u o t ; : 1 , & q u o t ; m e n u _ s h o w & q u o t ; : 1 , & q u o t ; p a g e _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; s h o w _ p a g e _ h e a d i n g & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; p a g e _ h e a d i n g & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; p a g e c l a s s _ s f x & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; m e n u - m e t a _ d e s c r i p t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; r o b o t s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ m e n u _ o p t i o n s & q u o t ; : { & q u o t ; m e g a m e n u & q u o t ; : & q u o t ; 0 & q u o t ; , & q u o t ; s h o w t i t l e & q u o t ; : & q u o t ; 0 & q u o t ; , & q u o t ; s u b t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; i c o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; c u s t o m c l a s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; w i d t h & q u o t ; : & q u o t ; 2 5 0 p x & q u o t ; , & q u o t ; m e g a m e n u _ w i d t h & q u o t ; : & q u o t ; 9 8 0 p x & q u o t ; , & q u o t ; a l i g n m e n t & q u o t ; : & q u o t ; r i g h t & q u o t ; , & q u o t ; m e g a m e n u _ d i r e c t i o n & q u o t ; : & q u o t ; r i g h t & q u o t ; , & q u o t ; r o w s & q u o t ; : & q u o t ; [ ] & q u o t ; , & q u o t ; b a d g e & q u o t ; : & q u o t ; 0 & q u o t ; , & q u o t ; b a d g e _ t e x t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; b a d g e _ c o l o r & q u o t ; : & q u o t ; # F F F & q u o t ; , & q u o t ; b a d g e _ b g c o l o r & q u o t ; : & q u o t ; # 0 0 0 & q u o t ; } , & q u o t ; a s t r o i d _ b a n n e r _ e n a b l e d & q u o t ; : & q u o t ; 0 & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ t i t l e _ e n a b l e d & q u o t ; : & q u o t ; 1 & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ s u b t i t l e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b u t t o n s & q u o t ; : [ ] , & q u o t ; a s t r o i d _ b a n n e r _ t e x t c o l o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ s u b t e x t c o l o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g c o l o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ p o s i t i o n & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ p o s i t i o n _ x & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ p o s i t i o n _ y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ r e p e a t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ s i z e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ w i d t h & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ b g i m a g e _ a t t a c h m e n t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ o v e r l a y _ c o l o r & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ t i t l e _ t a g & q u o t ; : & q u o t ; h 3 & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ s u b t i t l e _ t a g & q u o t ; : & q u o t ; s p a n & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ c l a s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ h e i g h t & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ w r a p p e r & q u o t ; : & q u o t ; c o n t a i n e r & q u o t ; , & q u o t ; a s t r o i d _ b a n n e r _ v i s i b i l i t y & q u o t ; : & q u o t ; a l l P a g e & q u o t ; , & q u o t ; a s t r o i d _ o p e n g r a p h _ m e n u i t e m & q u o t ; : & q u o t ; 0 & q u o t ; , & q u o t ; a s t r o i d _ o g _ t i t l e _ m e n u i t e m & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ o g _ d e s c _ m e n u i t e m & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ o g _ i m a g e _ m e n u i t e m & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ o g _ v i s i b i l i t y & q u o t ; : & q u o t ; c u r r e n t P a g e & q u o t ; , & q u o t ; a s t r o i d _ t r a c k i n g c o d e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b e f o r e h e a d & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b e f o r e b o d y & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ c u s t o m c s s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ c u s t o m c s s f i l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ c u s t o m j s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ c u s t o m j s f i l e s & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ p o s t t y p e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ r e a d t i m e & q u o t ; : & q u o t ; & q u o t ; , & q u o t ; a s t r o i d _ b a d g e & q u o t ; : & q u o t ; & q u o t ; } ' ; < b r / > $ p r e s s L f t = $ c u r r e n t L f t ; < b r / > $ p r e s s R g t = $ c u r r e n t R g t ; < b r / > $ p r e s s H o m e = 0 ; < b r / > / / $ p r e s s L a n g u a g e = . . . ; < b r / > $ p r e s s C l i e n t I D = 0 ; < b r / > < b r / > / / V a r i a b l e s f o r s l i d e r < b r / > $ p r e s s S l i d e r = ' 1 1 ' ; < b r / > $ p r e s s P u b l i s h e d = ' 1 ' ; < b r / > $ p r e s s F i r s t = ' 0 ' ; < b r / > / / M a x l e n g t h f o r t e x t i n s l i d e < b r / > $ m a x l e n g t h = 3 5 0 ; < b r / > $ p r e s s S l i d e = ' [ { & q u o t ; t y p e & q u o t ; : & q u o t ; c o n t e n t & q u o t ; , & q u o t ; p m & q u o t ; : & q u o t ; d e f a u l t & q u o t ; , & q u o t ; d e s k t o p p o r t r a i t f o n t s i z e & q u o t ; : 1 0 0 , & q u o t ; d e s k t o p p o r t r a i t v e r t i c a l a l i g n & q u o t ; : & q u o t ; c e n t e r & q u o t ; , & q u o t ; d e s k t o p p o r t r a i t m a x w i d t h & q u o t ; : 0 , & q u o t ; d e s k t o p p o r t r a i t i n n e r a l i g n & q u o t ; : & q u o t ; l e f t & q u o t ; , & q u o t ; d e s k t o p p o r t r a i t p a d d i n g & q u o t ; : & q u o t ; 1 0 | * | 1 0 | * | 1 0 | * | 1 0 | * | p x & q u o t ; , & q u o t ; d e s k t o p p o r t r a i t s e l f a l ign":"left","mobileportraitpadding":"10|*|10|*|10|*|10|*|px","opened":1,"id":"","uniqueclass":"n-uc-HXhRpGY7BrbB","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"bgimage":"","bgimagex":50,"bgimagey":50,"bgcolor":"ffffff00","bgcolorgradient":"off","bgcolorgradientend":"00000000","layers":[{"type":"row","pm":"normal","desktopportraitfontsize":100,"desktopportraitinneralign":"inherit","desktopportraitpadding":"35|*|30|*|35|*|30|*|px","desktopportraitgutter":20,"desktopportraitwrapafter":"0","desktopportraitmargin":"0|*|0|*|0|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":450,"desktopportraitselfalign":"inherit","mobileportraitpadding":"15|*|10|*|15|*|10|*|px","mobileportraitwrapafter":1,"mobilelandscapewrapafter":1,"opened":1,"id":"","uniqueclass":"n-uc-f8IPabEEkXFo","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"href":"#","href-target":"_self","aria-label":"","bgimage":"","bgimagex":50,"bgimagey":50,"bgcolor":"ffffffff","bgcolorgradient":"off","bgcolorgradientend":"00000000","borderwidth":"1|*|1|*|1|*|1","borderstyle":"none","bordercolor":"FFFFFFFF","borderradius":0,"boxshadow":"0|*|1|*|10|*|0|*|00000038","fullwidth":"1","stretch":"1","name":"Row","namesynced":1,"cols":[{"type":"col","pm":"default","desktopportraitfontsize":100,"desktopportraitverticalalign":"flex-start","desktopportraitmaxwidth":0,"desktopportraitinneralign":"inherit","desktopportraitpadding":"10|*|10|*|10|*|10|*|px","desktopportraitorder":0,"opened":1,"id":"","uniqueclass":"n-uc-yXsmrzks62ak","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"bgimage":"","bgimagex":50,"bgimagey":50,"bgcolor":"00000000","bgcolorgradient":"off","bgcolorgradientend":"00000000","colwidth":1,"href":"#","href-target":"_self","aria-label":"","borderradius":0,"boxshadow":"0|*|0|*|0|*|0|*|00000080","borderwidth":"1|*|1|*|1|*|1","borderstyle":"none","bordercolor":"ffffffff","name":"Col","namesynced":1,"layers":[{"type":"layer","pm":"normal","desktopportraitfontsize":100,"desktopportraitmargin":"0|*|0|*|0|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":0,"desktopportraitselfalign":"inherit","id":"","uniqueclass":"n-uc-s07ZIkoY4TB4","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"name":"","namesynced":1,"item":{"type":"text","values":{"content":"' . $pressCreated_Slide . '","font":"{\"data\":[{\"extra\":\"\",\"color\":\"8c8c8cff\",\"size\":\"16||px\",\"tshadow\":\"0|*|0|*|0|*|000000ff\",\"afont\":\"Arial\",\"lineheight\":\"1.5\",\"weight\":400,\"italic\":0,\"underline\":0,\"align\":\"inherit\",\"letterspacing\":\"normal\",\"wordspacing\":\"normal\",\"texttransform\":\"none\"},{\"extra\":\"\",\"color\":\"16b7ccff\"},{\"extra\":\"\"}]}","style":"","content-tablet-enabled":"0","contenttablet":"","content-mobile-enabled":"0","contentmobile":""}}},{"type":"layer","pm":"normal","desktopportraitfontsize":100,"desktopportraitmargin":"0|*|0|*|20|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":0,"desktopportraitselfalign":"inherit","tabletportraitfontsize":80,"mobileportraitfontsize":60,"id":"","uniqueclass":"n-uc-7QSpX96PgTQ6","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"name":"Day Twenty Eight: The First Mountai","namesynced":1,"item":{"type":"heading","values":{"font":"{\"data\":[{\"extra\":\"\",\"color\":\"1a1a1aff\",\"size\":\"30||px\",\"tshadow\":\"0|*|0|*|0|*|000000ff\",\"afont\":\"Arial\",\"lineheight\":\"1.3\",\"weight\":400,\"italic\":0,\"underline\":0,\"align\":\"inherit\",\"letterspacing\":\"normal\",\"wordspacing\":\"normal\",\"texttransform\":\"none\"},{\"extra\":\"\"}]}","style":"","priority":"div","fullwidth":"1","nowrap":"0","heading":"' . $pressTitle . '","title":"","href":"#","href-target":"_self","href-rel":"","split-text-transform-origin":"50|*|50|*|0","split-text-backface-visibility":1,"split-text-animation-in":"","split-text-delay-in":0,"split-text-animation-out":"","split-text-delay-out":0,"class":""}}},{"type":"layer","pm":"normal","desktopportraitfontsize":100,"desktopportraitmargin":"0|*|0|*|0|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":0,"desktopportraitselfalign":"inherit","id":"","uniqueclass":"n-uc-PRiYDIyNDMZs","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"name":"zigzag-1.png","namesynced":1,"item":{"type":"image","values":{"style":"","image":"$/images/slider6/zigzag-1.png","alt":"Image is not available","title":"","href":"#","href-target":"_self","href-rel":"","href-class":"","size":"auto|*|auto","cssclass":"","image-optimize":"1"}}},{"type":"layer","pm":"normal","desktopportraitfontsize":100,"desktopportraitmargin":"20|*|0|*|25|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":0,"desktopportraitselfalign":"inherit","mobileportraitfontsize":80,"id":"","uniqueclass":"n-uc-nN9SY2E2fpqq","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"name":"Lorem ipsum dolor sit amet, consect","namesynced":1,"item":{"type":"text","values":{"font":"{\"data\":[{\"extra\":\"\",\"color\":\"8c8c8cff\",\"size\":\"16||px\",\"tshadow\":\"0|*|0|*|0|*|000000ff\",\"afont\":\"Arial\",\"lineheight\":\"1.8\",\"weight\":400,\"italic\":0,\"underline\":0,\"align\":\"inherit\",\"letterspacing\":\"normal\",\"wordspacing\":\"normal\",\"texttransform\":\"none\"},{\"extra\":\"\",\"color\":\"16b7ccff\"},{\"extra\":\"\"}]}","style":"","content":"' . substr($pressIntrotext, 0, $maxlength) . " ..." . '","content-tablet-enabled":"0","contenttablet":"","content-mobile-enabled":"0","contentmobile":""}}},{"type":"layer","pm":"normal","desktopportraitfontsize":100,"desktopportraitmargin":"0|*|0|*|0|*|0|*|px","desktopportraitheight":0,"desktopportraitmaxwidth":0,"desktopportraitselfalign":"inherit","mobileportraitfontsize":80,"id":"","uniqueclass":"n-uc-RTjJ4dnBd5D4","generatorvisible":"","zindex":2,"class":"","crop":"visible","rotation":0,"parallax":0,"desktopportrait":1,"desktoplandscape":1,"tabletportrait":1,"tabletlandscape":1,"mobileportrait":1,"mobilelandscape":1,"name":"READ MORE","namesynced":1,"item":{"type":"button","values":{"font":"{\"data\":[{\"extra\":\"\",\"color\":\"ffffffff\",\"size\":\"14||px\",\"tshadow\":\"1|*|1|*|0|*|0000002b\",\"afont\":\"Arial\",\"lineheight\":\"1.5\",\"weight\":0,\"italic\":0,\"underline\":0,\"align\":\"center\",\"letterspacing\":\"1px\",\"wordspacing\":\"normal\",\"texttransform\":\"none\"},{\"extra\":\"\"}]}","style":"{\"data\":[{\"extra\":\"\",\"backgroundcolor\":\"054490ff\",\"opacity\":100,\"padding\":\"10|*|18|*|10|*|18|*|px\",\"boxshadow\":\"0|*|0|*|0|*|0|*|000000ff\",\"border\":\"0|*|solid|*|000000ff\",\"borderradius\":\"3\"},{\"extra\":\"\",\"backgroundcolor\":\"139fb1ff\"}]}","content":"READ MORE","nowrap":"1","fullwidth":"0","href":"http://localhost:8080/index.php/de-de/newsportal/' . $pressAlias . '","href-target":"_self","href-rel":"","class":"","icon":"","iconsize":"100","iconspacing":"30","iconplacement":"left"}}}]}]}]}]';
$pressDescription = $pressIntrotext;
$pressThumbnail = '';
$pressParams = '{"type":"slide","desktopportraitfontsize":"100","desktopportraitpadding":"20|*|70|*|60|*|70","tabletportraitpadding":"20|*|70|*|60|*|70","mobileportraitpadding":"20|*|10|*|60|*|10","record-slides":"1","thumbnailAlt":"","thumbnailType":"default","static-slide":"0","slide-duration":"0","ligthboxImage":"","background-animation":"","background-animation-color":"333333ff","background-animation-speed":"default","desktopportrait":"1","desktoplandscape":"1","tabletportrait":"1","tabletlandscape":"1","mobileportrait":"1","mobilelandscape":"1","href":"","href-target":"_self","aria-label":"","background-type":"image","backgroundColor":"ffffff00","backgroundGradient":"off","backgroundColorEnd":"ffffff00","backgroundColorOverlay":"0","backgroundImage":"https://images.pexels.com/photos/417074/pexels-photo-417074.jpeg?auto=compress&cs=tinysrgb&w=800","backgroundFocusX":"50","backgroundFocusY":"50","backgroundImageOpacity":"100","backgroundImageBlur":"0","backgroundAlt":"","backgroundTitle":"","backgroundMode":"default","backgroundBlurFit":"7","guides":"eyJob3Jpem9udGFsIjpbXSwidmVydGljYWwiOltdfQ==","version":"3.5.1.14"}';
$pressGenerator_id = 1;
//english version
$pressTitleTranslation = $article["titleTranslation"] ?? "";
$pressContentTranslation = $article["contentTranslation"] ?? "";
// Create a PressArticle object for each article
$pressArticle = new PressArticle($pressAssetID, $pressTitle, $pressAlias, $pressIntrotext, $pressFulltext, $pressState, $pressCatid, $pressCreated, $pressCreated_by, $pressModified, $pressModified_by, $pressImages, $pressUrls, $pressAttribs, $pressVersion, $pressOrdering, $pressMetakey, $pressMetadesc, $pressHits, $pressPublish_up, $pressAccess, $pressMetadata, $pressFeatured, $pressLanguage, $pressNote, $pressIsTopNews, $pressItem_ID, $pressStage_ID, $pressExtension, $pressMenuType, $pressPath, $pressLink, $pressType, $pressMenuParentID, $pressMenuLevel, $pressComponentID, $pressCheckedOut, $pressCheckedOutTime, $pressBrowseNav, $pressMenuAccess, $pressMenuImg, $pressTemplateStyleID, $pressMenuParams, $pressLft, $pressRgt, $pressHome, $pressClientID, $pressSlider, $pressPublished, $pressFirst, $pressSlide, $pressDescription, $pressThumbnail, $pressParams, $pressGenerator_id, $fullArticleUrl, $pressTitleTranslation, $pressContentTranslation);
$pressArticles[] = $pressArticle;
if($pressIsTopNews){
echo "adding english version\n"; // Debugging line
$pressArticleEnglish = new PressArticle($pressAssetID, $pressTitleTranslation, $pressAlias . " -en", $pressContentTranslation, "", $pressState, 32, $pressCreated, $pressCreated_by, $pressModified, $pressModified_by, $pressImages, $pressUrls, $pressAttribs, $pressVersion, $pressOrdering, $pressMetakey, $pressMetadesc, $pressHits, $pressPublish_up, $pressAccess, $pressMetadata, $pressFeatured, "en-GB", $pressNote, $pressIsTopNews, $pressItem_ID, $pressStage_ID, $pressExtension, $pressMenuType, $pressPath, $pressLink, $pressType, $pressMenuParentID, $pressMenuLevel, $pressComponentID, $pressCheckedOut, $pressCheckedOutTime, $pressBrowseNav, $pressMenuAccess, $pressMenuImg, $pressTemplateStyleID, $pressMenuParams, $pressLft, $pressRgt, $pressHome, $pressClientID, '12', $pressPublished, $pressFirst, $pressSlide, $pressDescription, $pressThumbnail, $pressParams, $pressGenerator_id, $fullArticleUrl, $pressTitleTranslation, $pressContentTranslation);
$pressArticles[] = $pressArticleEnglish;
}
// Increment $currentPressID for the next article
$currentPressID++;
$currentLft++;
$currentRgt++;
}
}
return $pressArticles;
Данные извлекаются из внешних источников.
Для каждой статьи создается объект PressArticle.
Объект вставляется в базу данных.
Что я пробовал:
- Вручную проверять базу данных на наличие существующих записей с помощью той же комбинации клавиш.
- Добавление суффикса в поле псевдонима для обеспечения уникальности, но это не решает проблему полностью.
Буду очень благодарен за любую помощь!
Подробнее здесь: https://stackoverflow.com/questions/792 ... s-language