Skip to content

Commit

Permalink
Remove entry_meta_key so we don't get the callback to override the te…
Browse files Browse the repository at this point in the history
…st value
  • Loading branch information
omarkasem committed May 15, 2024
1 parent a4f989d commit 66d280d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions includes/fields/class-gravityview-field-is-read.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class GravityView_Field_Is_Read extends GravityView_Field {

var $icon = 'dashicons-book-alt';

var $entry_meta_key = 'is_read';

var $entry_meta_is_default_column = true;

var $is_numeric = true;
Expand Down Expand Up @@ -137,8 +135,7 @@ public function print_script( $context ) {
name: 'is_read',
value: 1
}
})
.done(function() {
}).done(function() {
if(read_field.parents('tbody').length > 0){
read_field.find('td').text(read_label);
}else{
Expand Down

2 comments on commit 66d280d

@zackkatz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omarkasem Can you remember why you did this? Please share more information.

@omarkasem
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zackkatz
It's because the tests was failing at function
GravityView_Duplicate_Entry_Test::test_duplicate_basic
in line

		$this->assertEmpty( $duplicate_entry['is_starred'] );
		$this->assertEmpty( $duplicate_entry['is_read'] );

and when i checked it seemed that that when this property exist, it override the value in a callback, but i see that you solved it by adding

	public function add_entry_meta( $entry_meta ) {
		return $entry_meta;
	}

I didn't know that we can override it like that, I just looked at the is_starred class and it worked in the tests because it didn't have that property.

Please sign in to comment.