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

745: Check duplicate glossary entries #746

Merged
merged 8 commits into from Jul 2, 2017

Conversation

@toolstack
Copy link
Contributor

@toolstack toolstack commented Jun 23, 2017

Resolves #745.

@toolstack toolstack requested a review from ocean90 Jun 23, 2017
toolstack added 4 commits Jun 23, 2017
$created_glossary_entry = GP::$glossary_entry->create_and_select( $new_glossary_entry );
$find_parms = array(
'glossary_id' => $glossary->id,
'term' => $new_glossary_entry->term,

This comment has been minimized.

@ocean90

ocean90 Jun 27, 2017
Member

This should probably also include $part_of_speech

This comment has been minimized.

@toolstack

toolstack Jun 27, 2017
Author Contributor

Updated.

$this->notices[] = __( 'The glossary entry was created!', 'glotpress' );
if ( GP::$glossary_entry->find_one( $find_parms ) ) {
// Translators: %s is the glossary term that was attempted to be added.
$this->errors[] = sprintf( __( 'Error "%s" is a duplicate glossary entry!', 'glotpress' ), esc_html( $new_glossary_entry->term ) );

This comment has been minimized.

@ocean90

ocean90 Jun 27, 2017
Member

Maybe make that message similar to

return $this->die_with_error( __( 'Identical current or waiting translation already exists.', 'glotpress' ), 200 );

This comment has been minimized.

@toolstack

toolstack Jun 27, 2017
Author Contributor

Updated.

toolstack added 2 commits Jun 27, 2017
And make the error message more consitent with other ones in GP.
@ocean90
ocean90 approved these changes Jul 2, 2017
@ocean90 ocean90 added this to the 2.4 milestone Jul 2, 2017
@ocean90 ocean90 merged commit b72bed9 into develop Jul 2, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@ocean90 ocean90 deleted the 745-check-duplicate-glossary-entries branch Jul 2, 2017
@toolstack toolstack modified the milestones: 3.0, 2.4 Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.