WPML
סטטוס
נפתר
נפתר בגרסה
2.3.0

סקירה כללית של התקלה

לפעמים, ייתכן שתיתקל בשגיאה הקריטית הבאה:

  • Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘Argument ID must be numeric and greater than 0’

בעיה זו קשורה לתוסף WPML Media Translation. היא מתרחשת אם יש לך תמונה שאין לה נתוני קובץ מצורף והיא רק קישור מוחלט לתמונה.

פתרון עוקף

בעיה זו תתוקן בגרסה העתידית. כפתרון עוקף זמני, תוכל לבצע את השלבים הבאים.


  1. ערוך את הקובץ class-wpml-media-image-translate.php הנמצא בתיקייה ../wpml-media-translation/classes/images-translation/.

  2. השתמש בקוד הבא כדי להחליף את הפונקציה get_translated_image_by_url.
public function get_translated_image_by_url( $img_src, $source_language, $target_language ){

$attachment_id = $this->get_attachment_image_from_guid($img_src, $source_language);
if (!$attachment_id) {
$attachment_id = $this->get_attachment_image_from_meta($img_src, $source_language);
}
if ($attachment_id){
$size = $this->get_image_size_from_url($img_src, $attachment_id);

return $this->get_translated_image($attachment_id, $target_language, $size);
} else {
return $img_src;
};
}

כל התקלות הידועות →