The correct answer is: D. no error
The sentence "When has this book been published?" is grammatically correct. The verb "has been" is in the present perfect tense, which is used to talk about events that have happened or been completed in the past but have some connection to the present. In this case, the book has been published in the past, and the speaker is asking when that happened.
The other options are incorrect because they use different tenses. Option A, "had this book been," uses the past perfect tense, which is used to talk about events that happened before another event in the past. Option B, "was this book," uses the simple past tense, which is used to talk about events that happened at a specific time in the past. Option C, "will this book have been," uses the future perfect tense, which is used to talk about events that will happen before another event in the future.
In conclusion, the correct answer is D. no error. The sentence "When has this book been published?" is grammatically correct.