If LCD’s data lines are shared with other components like keypad, LCD will not work properly due to incorrect send function in liquid crystal library so if coder sets one of these pins as input, result will same. The send method does not set/control pin status before writing data. Below code can be added to LiquidCrystal.cpp
for (int i=0; i<((_displayfunction & LCD_8BITMODE) ? 8 : 4); ++i)
{
pinMode(_data_pins[i], OUTPUT);
}