Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid smw_parseerror and improve display of it #1101

Closed
WolfgangFahl opened this issue Aug 2, 2015 · 12 comments

Comments

Projects
None yet
3 participants
@WolfgangFahl
Copy link
Contributor

commented Aug 2, 2015

In german "Der eingegebene Wert wurde nicht verstanden", (English: "The given value was not understood") is displayed when an smw_parseerror happens with the example below.
The error should not happen and when it happens it should clearly state where it happes e.g. which property was about to be set. E.g. "Could not set value of property "has source " to "<source ..." due to a parse error - SMW can not set property values to values that are put within tags ..."

The property has source has type "Code" in this case but the issue seems to be independent of the type being used.

=== Test parseerror ===
<pre>
{{#subobject:-
|has source=http://www.semanticmediawiki.org}}
{{#subobject:-
|has source=<source lang='php'>class Test {}</source>}}
</pre>
{{#subobject:-
|has source=http://www.semanticmediawiki.org}}
{{#subobject:-
|has source=<source lang='php'>class Test {}</source>}}
{{#ask: [[has source::+]]
|?has source
}}
@JeroenDeDauw

This comment has been minimized.

Copy link
Member

commented Aug 2, 2015

So you are asking to have the message changed by adding the new of the property and improving its wording? Is that correct?

As to avoiding the error, I'm not sure what we can do there. If invalid input is entered, we cannot magically fix it.

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Aug 3, 2015

@JeroenDeDauw thanks for looking into this. IMHO the input is completly valid. see https://semantic-mediawiki.org/wiki/Issue:Smw_parseerror. It's just containing a tag like <source></source> - the same happens if you use <pre></pre> or <div></div> although I can't really tell the exact circumstances since the error message does not help in finding the culprit. A debugging option would be very useful here to find out what is going on. This issue is bothering me for about 1 1/2 years now and is one of the main obstacles to fully use SMW in our environment.

@JeroenDeDauw JeroenDeDauw added the bug label Aug 3, 2015

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Aug 9, 2015

http://semantic-mediawiki.org/wiki/Help:Type_Text
is a bit unspecific about what is valid content for a Text field and what is not.
I have modified http://semantic-mediawiki.org/wiki/Issue:Smw_parseerror to include a link to
http://semantic-mediawiki.org/wiki/Property:Has_improper_value_for

where the example shows as having an improper value. But why?

The issue is also mentioned in http://semediawiki-user.narkive.com/8qTi9IkU/using-ref-tags-in-fields-causes-the-given-value-was-not-understood-error and http://semantic-mediawiki.org/wiki/Help_talk:Properties_and_types#Tags_inside_Property_Value_1463

#794
seems to suggest a way to get this feature

@JeroenDeDauw JeroenDeDauw added feature and removed feature labels Oct 20, 2015

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Nov 2, 2015

https://phabricator.wikimedia.org/T51530 seems to have the same reason for not working. Text and code fields are parsed in a mediawiki-incompatible way.

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Nov 29, 2015

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Nov 29, 2015

see http://semantic-mediawiki.org/wiki/Help_talk:Properties_and_types#Tags_inside_Property_Value_1463
and
#794

The pull request in 794 seems not to be active - I'd love to test this. How could I get a version of SMW that contains this pull request?

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Jan 1, 2016

https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl/Workdocumentation_2015-12-31_WF shows how to get the pull request.

There are five points in the SMW code where an 'smw_parserror' is show.

  • SMW_DataValue
  • SMW_DV_Error
  • SMW_DV_Property_List
  • SMW_DV_Types
  • ImportValue

an improvement would be to add a parameter to the Message that gives some context information e.g. for the SMW_DataValue.php there should be a hint "The given value was not understood due to $1".

E.g. "The given value was not understood since it contains parser tags that can not be parsed by SMW".

This would be major change in the i18n section. I looks like there are 63 languages

neso:i18n wf$ grep smw_parse *.json | wc
      63     477    4845

That have a translation for this message.

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2016

Feel free to re-open this task after actionable items are clearly identifiable to drive this issue forward.

@mwjames mwjames closed this Mar 12, 2016

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2016

Just because this has not been worked on for a few weeks is IMHO no reason to close this bug. How can I reopen it?

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2016

Just because this has not been worked on for a few weeks is IMHO no reason to close this bug.

Either an issue is driven by user and to be completed in a commendable time frame (3 month of inactivity is not commendable) and without actionable tasks I'm considering this issue not longer relevant (and yes I have to go though the list of issues because no else makes house cleaning and I'm rather sick of year /six month old tasks no one cares about to maintain or report back).

Don't complain about this, I'd like issues to be done/solved and not rotting away in hopes of a white knight to take care of it.

@WolfgangFahl

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2016

This issue has been plaguing me for almost two years and I need it to go away. Otherwise i cannot continue using SMW at all because in the long run for my environment it must be fixed to make sure we don't have to use the ugly workarounds any more that have come up since we moved away from Lotus Notes to SMW. SMW can not store e.g. source code properly in semantic values at this time and this is a major feature of our old Lotus Notes environment that we are badly missing. I have spent quite a bit of time and effort to get this improved and even made sure I got into SMW development by specifically installing an IDE for it and what not. I think the attitude of closing issues just because they have been open for too long is not adequate for a situation like this.

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2016

This issue has been plaguing me for almost two years and I need it to go away. Otherwise i cannot continue using SMW at all because in the long run for my environment it must be fixed to make sure we don't have to use the ugly workarounds any more that have come up since we moved away from Lotus Notes to SMW.

Honestly, currently I'm the only one who actively develops SMW and my priorities are somewhere else so unless someone pops up and says I'd like do to this or I need some advice on how to implement this, chances are very slim that I ever going to have a look at this issue within a reasonable time.

All this means I'd expect someone to step up (otherwise this is going to rot away) and I don't have to come back in six moth just to have the same discussion all over again of maybe "someone, doing something, sometime" in future. (this just too many of some... without any specifics).

PS: "actionable" means it is clear on what to do, and how to test this so you don't waste hours in trying to interpret the problem or worst replicate the issue on the sandbox.

@mwjames mwjames referenced this issue Sep 1, 2016

Merged

Add more detailed error msg, refs 1101, 1805 #1816

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.