?
avatar Razzo1987
Razzo1987
27 Jan 2020

Steps to reproduce the issue

Try to create an article with this data:

"title":"La Nigeria prende in consegna l'ex procuratore generale Adoke per un affare di petrolio da 1,3 miliardi di dollari",
"catid":8,
"state":1,
"created":"2020-01-24 08:23:05",
"language":"*",
"metadesc":"ABUJA (Reuters) - Il cane da guardia del crimine finanziario della Nigeria ha accusato l'ex procuratore generale Mohammed Adoke ...",
"metakey":"",
"articletext":"<p>ABUJA (Reuters) - Il cane da guardia del crimine finanziario della Nigeria ha accusato l'ex procuratore generale Mohammed Adoke di aver presumibilmente ricevuto tangenti per facilitare un accordo petrolifero di $ 1,3 miliardi, ha detto l'agenzia in una nota gioved\u00ec.<\/p><div class=\"alert alert-info\" role=\"alert\">Articolo tradotto da <a href=\"http:\/\/feeds.reuters.com\/~r\/reuters\/AFRICATopNews\/~3\/mXLflbrOo7Q\/idAFKBN1ZN0HU-OZATP\" target=\"_blank\">Top Africa News<\/a>.<\/div>"
}

Expected result

Article created and published

Actual result

I recieve this error:

{
   "errors":[
      {
         "title":"Save failed with the following error: Data too long for column 'title' at row 1"
      }
   ]
}

System information (as much as possible)

Nightly of 26/01/2019

Additional comments

If I use a shorter title, the article is still inserted but is unpublished

avatar Razzo1987 Razzo1987 - open - 27 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jan 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Jan 2020
avatar SharkyKZ
SharkyKZ - comment - 27 Jan 2020

I can reproduce the issue without API. title column in #__assets table has 100 character limit. In J3 longer titles were truncated and in J4 the entry is not created.

avatar brianteeman
brianteeman - comment - 27 Jan 2020

I am not sure what you are expecting. You tried to submit an article with a title that was too long and correctly received a message that it could not be saved as the title was too long. When you submitted an article with a title that was short enough then the article was saved.

avatar wilsonge
wilsonge - comment - 27 Jan 2020

So the publish part is kinda a known issue - I’m not even 100% if it’s a bug. This is how workflows functions right now. State is effectively read only as a property - we’d need to update the workflow_id property.
I’ve written that up a bit more here #26841

avatar alikon
alikon - comment - 27 Jan 2020

or simply drop workflow as it is not ready

avatar brianteeman
brianteeman - comment - 27 Jan 2020

@alikon I will repeat what I said in Spain. If you believe that it is not ready then where are the issues reported that make that clear. Everything I see is relatively easy to fix.

avatar alikon
alikon - comment - 27 Jan 2020
avatar alikon
alikon - comment - 27 Jan 2020

it's bad design it is not a https://en.wikipedia.org/wiki/Finite-state_machine as it should be
and + simply use what it already used and tested like https://symfony.com/doc/current/workflow/workflow-and-state-machine.html

avatar brianteeman
brianteeman - comment - 27 Jan 2020

such a shame that this wasnt mentioned when it was submitted and then merged. I was the only one really saying it wasn't ready etc

avatar alikon
alikon - comment - 27 Jan 2020

it was , till someone blocked the discussion

This conversation has been locked as resolved and limited to collaborators.

avatar brianteeman
brianteeman - comment - 27 Jan 2020

where?

avatar brianteeman
brianteeman - comment - 27 Jan 2020

thanks - I was missing the locked one.

18 months since I said it wasn't ready and should be reverted then. A lot of work was done on it since then.

My point is that other than my closed call for it to be reverted there hasnt been any further discussion in 18 months

avatar alikon
alikon - comment - 27 Jan 2020

yes a lot of work has been done (after) to let it barely working, but my main concern it's about the performance of a real site with more than 100 articles, plus a team was setup to create an enhanced version before beta iirc (so it was clear from the start that wasn't ready)

avatar Razzo1987
Razzo1987 - comment - 27 Jan 2020

I can reproduce the issue without API. title column in #__assets table has 100 character limit. In J3 longer titles were truncated and in J4 the entry is not created.

Yes, but title column in #__content table has 255 character limit...

Also if I try to create the article from the back-end, as you correctly said, I get the same error.

But the strange thing is that going to see in the table #__content the article is present (creating the arcticle from the back-end or via API is the same):

immagine

avatar Razzo1987
Razzo1987 - comment - 27 Jan 2020

As regards the aspect of the publication workflow, I partially understood what was said.

What I don't understand is why it is different between creating articles from back end and with API.

As superuser I can safely create an article as already published by the back end:
immagine

avatar SharkyKZ
SharkyKZ - comment - 31 Jan 2020

@Razzo1987 try using condition property instead of state to set article status.

avatar SharkyKZ
SharkyKZ - comment - 31 Jan 2020

What do we do with assets table issue? Increase column length 255 and hope nobody uses longer titles? Truncate the title in code? Add some rollback actions?

avatar chmst
chmst - comment - 31 Jan 2020

I think, truncating the title in the code for the asset table has no risk, as the title is not used as identifier.

avatar korenevskiy
korenevskiy - comment - 6 Feb 2020

A 100-character header is not enough.
We don't make headlines to make it easy to search for an article in the archive. We create headlines to sell products, to write news, to attract people. Thus, the CMS must adapt to the needs, content Creators should not adapt to the CMS, especially when the CMS is at the development stage, we must and can already take into account the requirements of the market.

avatar chmst
chmst - comment - 6 Feb 2020

Maybe it is a misunderstanding. I meant the title in the table #__assets which is only visible for maintainers in the database. And think that the title there could be truncated.
In #__content the length of title is 255.

@korenevskiy Do you think this is to short?

avatar brianteeman
brianteeman - comment - 6 Feb 2020

I can reproduce the issue without API. title column in #__assets table has 100 character limit. In J3 longer titles were truncated and in J4 the entry is not created.

This is the issue. It isn't anything to do with the webservices API

avatar jwaisner jwaisner - change - 15 Apr 2020
Status New Confirmed
Build staging 4.0-dev
avatar alikon
alikon - comment - 20 Apr 2020

there are some issues when we have a very long article title like :
"La Nigeria prende in consegna l'ex procuratore generale Adoke per un affare di petrolio da 1,3 miliardi di dollari"

despite the content title of the#__content table field allows 255 chars
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/extensions.sql#L162
the#__assets table don't allows more than 100 chars
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/base.sql#L15

plus the #__finder_links' table field route
https://github.com/joomla/joomla-cms/blob/4.0-dev/installation/sql/mysql/extensions.sql#L262
will add some more chars to the title length

so even if the title length of an article in theory is 255 in pratice should be less than 200

avatar alikon
alikon - comment - 20 Apr 2020

a dirty attempt to circumvent is #28734

avatar alikon
alikon - comment - 21 Apr 2020

for the unpublished status when an article is submitted from the api
if you add "transition": 2 to the body of your POST request something like this
Screenshot from 2020-04-21 10-29-05

your article will be saved with the published status

Screenshot from 2020-04-21 10-32-50

don't forget to apply pr #28734
and "transition": 2 will work only if you are using the default workflow stage/transition

avatar alikon alikon - change - 21 Apr 2020
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2020-04-21 08:37:35
Closed_By alikon
avatar alikon
alikon - comment - 21 Apr 2020

so i'm closing this issue

avatar alikon alikon - close - 21 Apr 2020
avatar wilsonge
wilsonge - comment - 2 May 2020

@alikon wondering if it would be useful to give people a helpful hint in the API if they try to update the state field directly

avatar alikon
alikon - comment - 3 May 2020

maybe best to wait till the new workflow will land in core, and then reconsider it

Add a Comment

Login with GitHub to post a comment